Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2001-12-14 08:46:23


----- Original Message -----
From: David Abrahams <david.abrahams_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, December 14, 2001 10:17 AM
Subject: Re: [boost] typelists: MPL tutorial + partial review

>
> ----- Original Message -----
> From: "Peter Dimov" <pdimov_at_[hidden]>
>
> > I wonder, did anyone see my (half-serious) comp.std.c++ proposal to turn
> > templates into:
> >
> > template<A, B, C> class X;
> >
> > (partly motivated by the similarity between type list algorithms and
value
> > list algorithms.)
>
> Not me, and I don't have any idea what you're talking about above.
>
If I interpreted him correctly, Peter is proposing to vanish the (explicit)
distinction between type, non-type and template parameters.
That's why the syntax takes only identifiers (no more "class/typename"
keyword, for instance).

I'm not sure, however, if the actual 'kind' of argument (type, non-type or
template) can normally be deduced from the context, and
in particular, I'm not sure how would I distinguish between type and
non-type parameters in a metafunction definition:

Currently, we do something like:

template<int A,int B> struct add { static const int value = A + B ; } ;
template<class A,class B> struct add_t { static const int value = A::value +
B::value ; } ;

But, how would I do this without the explicit int/class differentiation?

Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com


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