Boost logo

Boost :

From: Mat Marcus (mmarcus_at_[hidden])
Date: 2001-11-28 23:28:56


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.
>

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));
  // ...

  _ Mat


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