Re: [Boost-users] [tuples] make_tuple_over a type-sequence

From: Yuval Ronen [mailto:ronen_yuval@yahoo.com]
Is there a meta-function that creates a tuple type which contains the types contained in a type-sequence? (I'm talking about a similar thing to variant's make_variant_over).
We use a generator like this: template<typename Typelist> struct TupleGen : boost::mpl::reverse_fold< Typelist, boost::tuples::null_type, boost::tuples::cons<boost::mpl::_2, boost::mpl::_1> > { };

EMalenfant@interstarinc.com wrote:
From: Yuval Ronen [mailto:ronen_yuval@yahoo.com]
Is there a meta-function that creates a tuple type which contains the types contained in a type-sequence? (I'm talking about a similar thing to variant's make_variant_over).
We use a generator like this:
template<typename Typelist> struct TupleGen : boost::mpl::reverse_fold< Typelist, boost::tuples::null_type, boost::tuples::cons<boost::mpl::_2, boost::mpl::_1> > { };
Great, thanks a lot. BTW, is there the opposite meta-function, i.e, getting a typelist out of an existing tuple type?

Yuval Ronen <ronen_yuval@yahoo.com> writes:
EMalenfant@interstarinc.com wrote:
From: Yuval Ronen [mailto:ronen_yuval@yahoo.com]
Is there a meta-function that creates a tuple type which contains the types contained in a type-sequence? (I'm talking about a similar thing to variant's make_variant_over).
We use a generator like this:
template<typename Typelist> struct TupleGen : boost::mpl::reverse_fold< Typelist, boost::tuples::null_type, boost::tuples::cons<boost::mpl::_2, boost::mpl::_1> > { };
Great, thanks a lot. BTW, is there the opposite meta-function, i.e, getting a typelist out of an existing tuple type?
If you use fusion, all your existing tuple types will be valid MPL type sequences. -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (3)
-
David Abrahams
-
EMalenfant@interstarinc.com
-
Yuval Ronen