[mpl] merging 2 maps
Hello, typedef mpl::map < mpl::pair<K1, V1>, mpl::pair<K2, V2>
m1;
typedef mpl::map < mpl::pair<K1, V3>, mpl::pair<K3, V4>
m2;
In the current version of boost, what's the right way to merge the 2 above mpl maps - to get 1 map that contains: mpl::pair<K1, V1>, mpl::pair<K1, V3>, mpl::pair<K2, V2> mpl::pair<K3, V4> Thanks.
Igor R wrote:
In the current version of boost, what's the right way to merge the 2 above mpl maps - to get 1 map that contains:
mpl::pair<K1, V1>, mpl::pair<K1, V3>, mpl::pair<K2, V2> mpl::pair<K3, V4>
Use fold with insert : fold<mp1, mp2, insert< _1, _2> > ? -- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35
Igor R wrote:
Use fold with insert :
fold<mp1, mp2, insert< _1, _2> >
?
Thanks! And what's the difference from:
typedef copy<m1, mpl::inserter<m2, insert<_1, _2> > >::type m3;
Which one should be faster About the same according to the semantic given here: http://www.boost.org/doc/libs/1_42_0/libs/mpl/doc/refmanual/copy.html
-- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35
participants (2)
-
Igor R
-
joel falcou