Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2002-06-13 23:13:32

"Douglas Gregor" <gregod_at_[hidden]> wrote in message
> On Thursday 13 June 2002 07:54 pm, Itay Maman wrote:
> > 2. Is direct recursion (i.e: variant<int, rec>) allowed?
> > I think we should not allow instantiations like this:
> > variant<int, rec> v1;
> Direct recursion seems to cause more headaches than it fixes

Direct recursion would be *very* desirable. I could enable it in a
couple of limited instances, but unfortunately not in the general

The classic example is when you want to define a tree. A binary tree
node is either a leaf or a pair of tree nodes:

typedef Variant<TYPELIST_2(Leaf, std::pair<Self*, Self*>)>


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