Boost logo

Boost :

Subject: Re: [boost] Review Request: Variadic Macro Data library
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2011-02-21 11:57:54


On Mon, Feb 21, 2011 at 3:57 AM, Paul Mensonides <pmenso57_at_[hidden]> wrote:
> To summarize what I would prefer:
>
> BOOST_VMD_DATA_SIZE(...)
>  -> BOOST_PP_VARIADIC_SIZE(...)
>
> BOOST_VMD_DATA_ELEM(n, ...)
>  -> BOOST_PP_VARIADIC_ELEM(n, ...)
>
> BOOST_VMD_DATA_TO_PP_TUPLE(...)
>  -> (nothing, unless workarounds are necessary)
>
> BOOST_VMD_DATA_TO_PP_ARRAY(...)
>  -> BOOST_PP_TUPLE_TO_ARRAY((...))
>  or BOOST_PP_TUPLE_TO_ARRAY(size, (...))
>
> BOOST_VMD_DATA_TO_PP_LIST(...)
>  -> BOOST_PP_TUPLE_TO_LIST((...))
>  or BOOST_PP_TUPLE_TO_LIST(size, (...))
>
> BOOST_VMD_DATA_TO_PP_SEQ(...)
>  -> BOOST_PP_TUPLE_TO_SEQ((...))
>  or BOOST_PP_TUPLE_TO_SEQ(size, (...))

Sorry if I am a bit slow and ask for clarifications. Would this work as follow?

a) If NO_VARIADIC, PP_TUPLE_TO_SEQ always requires 2 arguments for
both the size and the tuple -- as in PP_TUPLE_TO_SEQ(size, (...)).

b) If VARIADIC instead, the same PP_TUPLE_TO_SEQ macro can either
accept 1 argument for the tuple -- as in PP_TUPLE_TO_SEQ((...)) -- or
accept 2 arguments for both the size and the tuple as in a).

Is this correct? Thanks a lot!

> BOOST_VMD_PP_TUPLE_SIZE(tuple)
>  -> BOOST_PP_TUPLE_SIZE(tuple)
>  or BOOST_PP_TUPLE_SIZE(size, tuple)
>
> BOOST_VMD_PP_TUPLE_ELEM(n, tuple)
>  -> BOOST_PP_TUPLE_ELEM(n, tuple)
>  or BOOST_PP_TUPLE_ELEM(size, n, tuple)
>
> BOOST_VMD_PP_TUPLE_REM_CTOR(tuple)
>  -> BOOST_PP_TUPLE_REM_CTOR(tuple)
>  or BOOST_PP_TUPLE_REM_CTOR(size, tuple)
>
> BOOST_VMD_PP_TUPLE_REVERSE(tuple)
>  -> BOOST_PP_TUPLE_REVERSE(tuple)
>  or BOOST_PP_TUPLE_REVERSE(size, tuple)
>
> BOOST_VMD_PP_TUPLE_TO_LIST(tuple)
>  -> BOOST_PP_TUPLE_TO_LIST(tuple)
>  or BOOST_PP_TUPLE_TO_LIST(size, tuple)
>
> BOOST_VMD_PP_TUPLE_TO_SEQ(tuple)
>  -> BOOST_PP_TUPLE_TO_SEQ(tuple)
>  or BOOST_PP_TUPLE_TO_SEQ(size, tuple)
>
> BOOST_VMD_PP_TUPLE_TO_DATA(tuple)
>  -> BOOST_PP_TUPLE_REM_CTOR(tuple)
>  or BOOST_PP_TUPLE_REM_CTOR(size, tuple)
>
> BOOST_VMD_PP_ARRAY_TO_DATA(array)
>  -> BOOST_PP_ARRAY_ENUM(array)
>
> BOOST_VMD_PP_LIST_TO_DATA(list)
>  -> BOOST_PP_LIST_ENUM(list)
>
> BOOST_VMD_PP_SEQ_TO_DATA(seq)
>  -> BOOST_PP_SEQ_ENUM(seq)
>
> also add:
>  BOOST_PP_REM, BOOST_PP_EAT
>
> The basic gist is to add the low-level variadic stuff and adapt the
> existing tuple stuff to not require the size.

-- 
Lorenzo

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