Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2002-06-13 09:16:01

----- Original Message -----
From: "Andrei Alexandrescu" <andrewalex_at_[hidden]>
Newsgroups: gmane.comp.lib.boost.devel
To: <boost_at_[hidden]>
Sent: Thursday, June 13, 2002 3:18 AM
Subject: [boost] Re: Re: Proposal --- A type-safe union

> [snipped]
> What I also believe, in contradiction with some participants, is that
> Variant should use typelists. If not, then Variant will factionally
> develop its own little typelist facility (as some other libraries in
> boost do today) and this doesn't work very nicely.
I realized that a typelist interface is the only way (ok, the easiest way)
to allow metaprograms to generate a variant of a set of types collected by
the metaprogram.
That is, with variant<types>, I have all ways to generate the type-set at
compile-time (for instance, using a filter to make sure all types are
different). This is a lot more difficult with variant<T0,T1,...,TN>.

BTW, does variant *require* all types to be different? I think this
requirement is reasonable, and it could turn out to be quite useful for
variant based algorithms.

Fernando Cacciola
Sierra s.r.l.

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