Boost logo

Boost Users :

From: Chris Weed (chrisweed_at_[hidden])
Date: 2007-03-22 19:27:32


On 3/22/07, Christian Henning <chhenning_at_[hidden]> 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 <boost/mpl/find_if.hpp>
>
> using namespace std;
> using namespace boost;
>
> typedef mpl::vector<char, char> vec_1;
> typedef mpl::vector<char, int> vec_2;
>
> typedef mpl::vector<vec_1, vec_2> mat;
>

I would think you need to use mpl::at_c here. I haven't test this, but
how about:

typedef mpl::find_if<mat, is_same<mpl::at_c<mpl::_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_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net