Boost logo

Boost :

Subject: Re: [boost] Review Request: Variadic Macro Data library
From: Edward Diener (eldiener_at_[hidden])
Date: 2011-02-21 19:18:05


On 2/21/2011 6:47 PM, Lorenzo Caminiti wrote:
> On Mon, Feb 21, 2011 at 6:40 PM, Lorenzo Caminiti<lorcaminiti_at_[hidden]> wrote:
>>
>> IMO, it would be nice if Boost.Preprocessor supported variadics to
>> make metaprogramming [2] easy. However, that does not necessarily mean
>> providing:
>>
>> BOOST_PP_VARIADIC_TUPLE(...)
>>
>> I would find having these two macros just as useful (and perhaps more correct):
>>
>> #define BOOST_PP_TO_TUPLE(...) (__VA_ARGS__)
>> BOOST_PP_TUPLE((...))
>>
>> Then at some point in my pp metaprogram, I will have
>> `BOOST_PP_TUPLE(BOOST_PP_TO_TUPLE(__VA_ARGS__))` which would be as
>> convenient for me (a pp metaprogrammer) to use as
>> `BOOST_PP_TUPLE(__VA_ARGS__)` directly. Of course, the
>> `BOOST_PP_TO_TUPLE(__VA_ARGS__)` invocation will be hidden inside
>> `BOOST_LOCAL_FUNCTION_PARAMS(...)` expansion to respect my library
>> users' request that the `PARAMS` macro invocation should look like a
>> normal C++ function parameter declaration as much as possible.
>>
>> In summary, I would think that providing `BOOST_PP_TO_TUPLE(...)` and
>> `BOOST_PP_TUPLE((...))` is a good approach.
>
> Sorry, when I said `BOOST_PP_VARIADIC_TUPLE(...)` and
> `BOOST_PP_TUPLE((...))` I meant of course
> `BOOST_PP_VARIADIC_TUPLE_TO_SEQ(...)` and
> `BOOST_PP_TUPLE_TO_SEQ((...))` (or some other pp tuple macro but
> without the size argument).

I am oppose to such redundancy. I think BOOST_PP_TUPLE_TO_SEQ(...) is
enough.


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