Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2002-06-13 10:13:22


"Douglas Gregor" <gregod_at_[hidden]> wrote in message
news:200206130758.12897.gregod_at_cs.rpi.edu...
> On Thursday 13 June 2002 02:18 am, Andrei Alexandrescu wrote:
> > What I also believe, in contradiction with some participants, is
that
> > Variant should use typelists.
>
> For the interface or just the implementation? I don't see how we
could avoid
> typelists in the implementation, but we don't need them in the
interface. We
> have a choice between:
>
> template<typename T1, typename T2 = unused2, ..., typename TN =
unused3>
> class variant;
>
> and
>
> template<typename Types>
> class variant;

For the interface AND the implementation. When developing an
application, one might put a collection of types in a typedef of a
typelist. Then, that type definition can be used in many parts of the
application, and in particular can be passed to the Variant as well.

Otherwise, one would have to maintain two separate lists of types, one
in the typelist and the other in the Variant instantiation.

Andrei


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk