|
Boost : |
Subject: Re: [boost] Review Request: Variadic Macro Data library
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2011-02-21 14:22:41
> So, in the following scenarios:
>
> #define MACRO(x) [x]
>
> MACRO(123) // [123]
> MACRO( 123 ) // [ 123 ]
> MACRO( 123 ) // [ 123 ]
> // adjacent whitespace is combined
> // in an earlier phase of translation
>
> MACRO( ) // [<placemarker>] -> []
> MACRO() // [<placemarker>] -> []
>
> For variadics, for the purposes of substitution, token-pasting, and
> stringizing, all of the variadic arguments act as one argument:
>
> #define MACRO(...) [__VA_ARGS__]
>
> MACRO() // [<placemarker>] -> []
> MACRO( ) // [<placemarker>] -> []
> MACRO(a) // [a]
> MACRO(a,b) // [a,b]
> MACRO(a, b) // [a, b]
> MACRO( a,b, c ) // [ a,b, c ]
>
> * Note that I don't know of a single preprocessor that actually handles
> whitespace correctly in all cases.
Damn, I know I had that right in Wave at some point. Must have broken it later... And apparently there are no tests in Wave verifying this is functioning as expected.
I'll fix both things asap.
Regards Hartmut
---------------
http://boost-spirit.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk