|
Boost : |
Subject: Re: [boost] [TTI] Review
From: Edward Diener (eldiener_at_[hidden])
Date: 2011-07-12 10:47:32
On 7/12/2011 12:08 AM, Vicente Botet wrote:
>
> Joel falcou-4 wrote:
>>
>> On 10/07/11 22:59, Edward Diener wrote:
>>> I will look into this. It is obviously more difficult programming with
>>> the latter than the former, but it is probably doable although with much
>>> effort. It may not be worth the effort.
>>>
>>> What the former syntax reflects is an exact transcription of the
>>> template parameters with each comma replaced by ')(' and a starting and
>>> ending parentheses. So for the template:
>>>
>>> 'template<class,class,int,class,template<class> class
>>> InnerTemplate,class,long> struct ManyParameters { }'
>>>
>>> the parameters are:
>>>
>>> '(class)(class)(int)(class)(template<class> class
>>> InnerTemplate)(class)(long)'
>>>
>>> and all I had to do as an end-user was copy the template parameters, add
>>> a '(' at the beginning, add a ')' at the end, and change every ',' to a
>>> ')('. As a programmer I take the sequence and directly convert it to the
>>> template parameters via a BOOST_PP_SEQ_ENUM.
>>>
>>
>> Dunno if it helps but nt2 has a NT2_STRIP macro adapted from a amcro
>> pasoted by Steven Watanabe that conditionnally remove parens around
>> symbols. You can then pass parameters containing comma to the
>> preprocessor this way :
>>
>> FOO( (template<class T, class U> struct foo) )
>>
>> and this way if no comma is involved
>>
>> FOO( struct bar )
>>
>> THe cod eis available under Boost licensing and can be incorporated w/e
>> your need.
>>
>>
>
> Hi,
>
> if the Joel proposal works for variadic anon variadic preprocessors it
> should retained by the library. It is much more clear than any other syntax,
> as follows the C++ one.
I do not know what you mean by the "Joel proprosal".
Eddie
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk