Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2002-06-13 11:02:24


"Andrei Alexandrescu" <andrewalex_at_[hidden]> wrote in message
news:aeacuc$43d$1_at_main.gmane.org...
> "Douglas Gregor" <gregod_at_[hidden]> wrote in message
> news:200206130758.12897.gregod_at_cs.rpi.edu...
> > [...]
> > 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.
> [...]

Maybe this is overkill, but would it be possible to support *both*
interfaces? Is there some compile-time magic that would allow the
variant class to detect if the first argument were a typelist, and handle
that appropriately? I can see that typelists are essential for
metaprogramming, but I like the convenience of the non-typelist
interface.

Dave


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