Boost logo

Boost :

From: Hamish Mackenzie (boost_at_[hidden])
Date: 2001-11-26 11:25:53


On Mon, 2001-11-26 at 13:46, David Abrahams wrote:
> MPL uses a traits mechanism to make type_list<T1, T2, T3> equivalent to
> cons<T1, cons<T2, cons<T3, null_type> > > as far as its algorithms are
> concerned. What's wrong with that approach? It seems to be the best of all
> worlds (currently possible in C++).

The problem with this approach is that you have a fixed limit to the
size of a type list (that the user cannot avoid with some kind of append
opperation) or else...

append< type_list< int >, type_list< float > >::result
is not the same type as
type_list< int, float >

Using the macros
TYPELIST_2( int, float )
and
TYPELIST_1_T( int, TYPELIST_1( float ) )
yeild the same result and the user can chain together as many _T macros
as they like.

Also it might be easier to convince people to "fix" the language if we
use macros as a patch :-)

Hamish


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