Boost logo

Boost :

Subject: Re: [boost] [TTI] Review
From: Edward Diener (eldiener_at_[hidden])
Date: 2011-07-12 18:51:45


On 7/12/2011 5:45 PM, Jeffrey Lee Hellrung, Jr. wrote:
> On Tue, Jul 12, 2011 at 8:30 AM, Edward Diener<eldiener_at_[hidden]>wrote:
> [...]
>
>> There is no reason to prefer replacing '<' and'>' in the syntax for the
>> template parameters with '(' and ')' other than to complicate matters
>> unnecessarily.
>>
>
> That, of course, is not entirely true; it's an alternative to replacing only
> commas with ")(", which makes things unnatural to read.
>
> After thinking about this last night I have decided to use a pp-array
>> instead of a pp-seq as the extended syntax for the non-variadic version and
>> as an alternate syntax for the variadic version. So the syntaxes for
>> TTI_TEMPLATE,
>>
>> using 'template<class,class,class> struct xxx' and
>> using 'template<class,int,template<**class,class> > struct yyy' are:
>>
>> TTI_TEMPLATE(xxx,BOOST_PP_NIL) // (1) non-variadic only
>> TTI_TEMPLATE(xxx) // (2) variadic only
>> TTI_TEMPLATE(yyy,(3,(class,**int,template<class,class>))) // (3) both
>>
> [...]
>
> Isn't the above a size 4 Boost.PP Array? Or are you purposely demonstrating
> the ease with which the user would make mistakes with this syntax? :)

You copied it wrong from my reply. Are you purposely demonstrating the
ease by which template parameters may be copied incorrectly <g> ?

You are right that it should be:

TTI_TEMPLATE(yyy,(4,(class,int,template<class,class>))) // (3) both

Despite my error in counting commas ( or addding 1 to my count ), I
prefer this syntax rather than inventing a different one. I realized
that it is easier presenting a pp-array than a pp-seq, as long as one
can simply count commas ( unlike yours truly ).

Eddie


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