Boost logo

Boost :

Subject: Re: [boost] [local] Simplifying the parenthesized syntax
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2011-02-07 16:54:21


On Mon, Feb 7, 2011 at 2:23 PM, Edward Diener <eldiener_at_[hidden]> wrote:
> On 2/7/2011 11:08 AM, Lorenzo Caminiti wrote:
>> 2   TOWARD THE NORMAL PARAMETER LIST SYNTAX (C99 preprocessor)
>>
>> Using variadic macros I _might_ be able to use a variable length tuple
>> (can I? I am not very familiar with these yet...) instead of a
>> sequence to represent the function parameters:
>>
>>     (void) (f)(int x, double&  y, const bind a, const bind&  b, bind&  c,
>> bind d) // [2]
>>
>> I think, this is a great simplification over [0] because it is the
>> exact same syntax used by C++ to declare function parameters!
>
> Please look at my variadic_macro_data library in the sandbox for how you can

Yes, I will use your library when I start coding. Thanks a lot!

> use variadic macros with the Boost PP library. And yes, variadic macros can
> give you a variable length number of elements. You can also use my library
> to get the number of elements of a Boost PP tuple as well as any element
> within the Boost PP tuple, and you can use my library to get the number of
> elements of variadic data as well as any element of the variadic data.
>
> The main thing to remember about variadic macros, which is their main
> limitation, is that within any variadic macro specified the variadic data
> must come at the end of the macro when the macro is defined using the ...
> notation.

-- 
Lorenzo

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