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. 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?