Boost logo

Boost :

From: Martin Apel (martin.apel_at_[hidden])
Date: 2007-08-14 10:10:46

Aleksey Gurtovoy wrote:
> Martin Apel wrote in message
>> Aleksey Gurtovoy wrote:
>>> All in all, to get the behavior you want with the current library you
>>> need to actually merge two maps into a third one.
> [...]
>> I'm not sure, if I understand this correctly. What is the recommended
>> way of merging two maps into a third one? Is it possible with the
>> current MPL implementation?
> Sure.
>> I only found an map::insert metafunction
>> to insert a single element, but not a whole range of pairs.
> You can actually to do something along these lines (untested):
> typedef copy<
> joint_view<Map1,Map2>
> , inserter< map0<>, insert<_1,_2> >
> >::type JointMap;
> --
> Aleksey Gurtovoy
> MetaCommunications Engineering
I still had no luck getting this to work. It seems that the typedef for
the joint map is OK (I had to change the insert to use a third
parameter as follows:

typedef copy<
   inserter <map0<>, insert<_1, end<_1>::type, _2> >
>::type JointMap;

otherwise it wouldn't compile).
However as soon as I try to access the result using

   std::cout << at<JointMap, int_<2> >::type::value << "\n";

I got tons of compile errors, from at_impl.hpp like the following:
error: no type named `type' in `struct boost::mpl::advance<mpl_::void_,
mpl_::int_<2> >'
advance_forward.hpp:42: error: no type named `type' in `struct

It seems that at still is not happy with the type it is given.



Virus checked: AVKA 17.383 from 13.08.2007

Boost list run by bdawes at, gregod at, cpdaniel at, john at