Thanks, I tried it but seems like my compiler (MSVC 7.1) doesn't eat
it. The error messages are:
c:\boost\boost\mpl\aux_\preprocessed\plain\apply_wrap.hpp(38) : error
C2903: 'apply' : symbol is neither a class template nor a function
template
c:\boost\boost\mpl\aux_\preprocessed\plain\apply.hpp(43) : see
reference to class template instantiation
'boost::mpl::apply_wrap1' being compiled
with
[
F=boost::mpl::lambdaboost::mpl::_1,1,int>>::type,
T1=boost::mpl::deref,boost::mpl::protectboost::mpl::_1,1,int>>>>::first_,void>::iterator>::type
]
c:\boost\boost\mpl\aux_\iter_apply.hpp(28) : see reference to
class template instantiation 'boost::mpl::apply1' being compiled
with
[
F=boost::is_sameboost::mpl::_1,1,int>,
T1=boost::mpl::deref,boost::mpl::protectboost::mpl::_1,1,int>>>>::first_,void>::iterator>::type
]
c:\boost\boost\mpl\not.hpp(41) : see reference to class
template instantiation 'boost::mpl::aux::iter_apply1'
being compiled
with
[
F=boost::is_sameboost::mpl::_1,1,int>,
Iterator=boost::mpl::aux::iter_fold_if_null_step,boost::mpl::protectboost::mpl::_1,1,int>>>>::first_,void>::iterator
]
c:\boost\boost\mpl\aux_\preprocessed\plain\and.hpp(25) : see
reference to class template instantiation 'boost::mpl::not_<T>' being
compiled
with
[
T=boost::mpl::aux::iter_apply1boost::mpl::_1,1,int>,boost::mpl::aux::iter_fold_if_null_step,boost::mpl::protectboost::mpl::_1,1,int>>>>::first_,void>::iterator>
]
c:\boost\boost\mpl\aux_\preprocessed\plain\and.hpp(55) : see
reference to class template instantiation
'boost::mpl::aux::and_impl' being compiled
with
[
C_=true,
T1=boost::mpl::apply1boost::mpl::_1,1,int>>>,boost::mpl::aux::iter_fold_if_null_step,boost::mpl::protectboost::mpl::_1,1,int>>>>::first_,void>::iterator>,
T2=boost::mpl::true_,
T3=boost::mpl::true_,
T4=boost::mpl::true_
]
[snip]
The code looks like this:
#include "boost/mpl/vector.hpp"
#include
#include
using namespace std;
using namespace boost;
typedef mpl::vector vec_1;
typedef mpl::vector vec_2;
typedef mpl::vector mat;
//typedef mpl::find_if >::type iter;
typedef mpl::find_ifmpl::_1,1, int> >::type iter;
int _tmain(int argc, _TCHAR* argv[])
{
BOOST_STATIC_ASSERT(( is_same< mpl::deref<iter>::type, vec_2 >::value ));
return 0;
}
Regards,
Christian
On 3/22/07, Chris Weed wrote:
On 3/22/07, Christian Henning wrote:
Thanks Chris for the quick response. I was trying find_if but I don't
think it provides the whole solution. Below is the minimal example,
that doesn't compile since the static assertion fires.
#include "boost/mpl/vector.hpp"
#include
using namespace std;
using namespace boost;
typedef mpl::vector vec_1;
typedef mpl::vector vec_2;
typedef mpl::vector mat;
I would think you need to use mpl::at_c here. I haven't test this, but
how about:
typedef mpl::find_ifmpl::_1,1, int> >::type iter;
int _tmain(int argc, _TCHAR* argv[])
{
BOOST_STATIC_ASSERT(( is_same< mpl::deref<iter>::type, vec_2 >::value ));
return 0;
}
Do you know what I'm missing here?
Christian
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users