Boost logo

Boost :

From: Hamish Mackenzie (boost_at_[hidden])
Date: 2001-11-28 23:49:29


On Thu, 2001-11-29 at 04:28, Mat Marcus wrote:
> David A. Greene wrote:
>
> > > The problem with macros, as Andrei pointed out, is commas.
> >> Passing multi-parameter templates to the macro is impossible.
> >> I just ran into this problem today in a completely unrelated
> > > area. :(
>
> ...
> Hamish Mackenzie wrote:
> >Can we add a set of macros to the PREPROCESSOR library to allow macro
> >parameters with one or more comma not contained in a token?
> >
> >#BOOST_HAS_0_COMMA( S0 ) S0
> >#BOOST_HAS_1_COMMA( S0,S1 ) S0,S1
> >#BOOST_HAS_2_COMMA( S0,S1,S2 ) S0,S1,S2
> >etc.
sorry I forgot the #define btw.
>
> Umm, I guess I'm missing the point here. Why do we need these macros?
> Plain old parenthesis are the usual idiom aren't they? E.g.
>
> // ...
> BOOST_STATIC_CONSTANT(bool, same = (is_same<TList::head, T>::value));
> // ...
>

Yes I should have made it clear that the problem I was hoping to address
was this...

template< class T > class b;

template<>
class b< TYPELIST_1( BOOST_HAS_1_COMMA( std::pair< int, float > ) ) >
{
};

Hamish


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