Boost logo

Boost :

From: Hamish Mackenzie (boost_at_[hidden])
Date: 2001-11-26 12:29:55


On Mon, 2001-11-26 at 15:35, David Abrahams wrote:
> Yes: one might want to use one's tuple metaprogramming libraries on a tuple
> type supplied by some 3rd-party library. The MPL provides a traits-based
> mechanism which allows any number of different type lists to be used with
> its algorithms. A similar approach could be taken for tuples.

Would we still be able to do this if type_list had a kind of default
tuple behavour if instantiated?

The advantage of doing so is that we could write

class foo
{
public:
  type_list< int, float > x;
};

instead of

class foo
{
public:
  tuple< type_list< int, float > > x;
};

Now I think about it I am not convinced that the shorter syntax is
better as it is biassed towards tuples and typelists are userful for
many other things too. However it is sort of nice that instantiating a
type list instantiates the types of the list. Kind of makes sense that
it should.

Hamish


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