Boost logo

Boost Users :

From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2006-06-19 06:54:47


Hello all,

somehow I have extreme difficulties to use mpl. Please do not understand this as any kind of
blaming. I find the library really great and the possiblities it offers are tremendous. Currently
I have some sort of problem, where I stuck at:

I have an mpl::vector instance of form (mpl namespace was left out for better readability):
class A;
class B;
class C;

typedef vector<
 pair<int_<0>, A>,
 pair<int_<1>, B>,
 pair<int_<2>, C> > types_vector;

Now I would like to use the mpl::transform algorithm to transform this vector into the mpl::map.
I try to do it in the following way:
  typedef mpl::transform<type_vector, mpl::insert<mpl::map<>, mpl::_1 >::type type_map;
And I also understand that _1 has no embedded typedefs for first and second, what a pair should
have, so I am stuck here.

David pointed me to the MPL Book, which I ordered, but unfortunately it is on the way to me... So
if someone could help I would be really thankful.

With Kind Regards,

Ovanes Markarian


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