Yuval Ronen writes:
Yuval Ronen wrote:
Aleksey Gurtovoy wrote:
Yuval Ronen writes:
I have the following code:
#include <utility> #include
#include template <typename MplPair> struct make_ptr_pair1 { typedef std::pair
type; ^^^ mpl I'm really puzzled about this. Why can't I have std::pair here? The whole purpose of the transform operation is to create a type-sequence of std::pairs. This sequence can be used, for example, with make_variant_over to create a variant of std::pairs. Can't I do that?
Ah, I think I got it. When the input to mpl::transform is a mpl::map, then it tries to generate a mpl::map as output, and therefore the need for mpl::pair.
Correct.
However, I don't need mpl::map as output, any Forward Sequence will suffice (as this is what make_variant_over requires). So is mpl::fold the answer here?
No, you can still use 'transform', like this: typedef mpl::front_inserter< mpl::vector0<> > inserter; typedef mpl::transform< my_map, make_ptr_pair1mpl::_1, inserter >::type ptr_pair_seq1; Sorry for the late reply, -- Aleksey Gurtovoy MetaCommunications Engineering