Boost logo

Boost :

From: Eric Friedman (ebf_at_[hidden])
Date: 2003-11-03 18:21:03

Joel de Guzman wrote:

> Since modern boost libraries with a typelist interface such as tuples
> and variant use MPL anyway, it would be nice to expose a typelist
> typedef so that people can get the typelist and process it using MPL.

I wholeheartedly agree. In fact,


exposes an MPL typesequence containing the logical types of the variant.

Thus, for instance,

       variant< int, std::string >::types
     , mpl::vector2< int, std::string >


       variant< int, recursive_wrapper< X > >::types
     , mpl::vector2< int, X >

However, ...

David Abrahams wrote:

> Ahem. Tuples should already be functioning mpl type sequences, IMO.
> It would be nice if variant would be the same. If not possible in
> either case for some reason, there should be a *non-intrusive*
> type_sequence<X>::type metafunction invocation which gets the type
> sequence.

No offense, but I believe it is a *terrible* idea for any type to have
the dual meanings of 'type sequence' and 'value type'. I've raised this
before; see

As always, please feel to tell me if/why I'm wrong.


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