Boost logo

Boost :

Subject: Re: [boost] [parameter] named template parameters
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2011-11-02 19:34:29


On Wed, Nov 2, 2011 at 6:24 PM, Dave Abrahams <dave_at_[hidden]> wrote:
> The following message is a courtesy copy of an article
> that has been posted to gmane.comp.lib.boost.devel as well.
>
>
> on Wed Nov 02 2011, Lorenzo Caminiti <lorcaminiti-AT-gmail.com> wrote:
>
>> Hello all (and especially Boost.Parameter's authors),
>>
>> The Boost.Parameter docs suggest to implement parameter-enabled class
>> templates using a series of typedes for the argument pack and the
>> actual argument types. I think it is best to define extra template
>> parameters with default values to old the argument pack Args and named
>> template parameters ClassType, etc as shown below. This allows to use
>> the named template parameters within the class declaration for example
>> in a base class (boost::python::class_<ClassType, ...>) instead that
>> just in the class definition.
>>
>> Do you see any problem in using extra template parameter to define the
>> argument pack and named template parameters?
>
> Lorenzo, I can't read your code.  Could you please try posting it as an
> inline attachment or something so that it comes out legibly?

Sorry, I'm attaching it as plain text (I don't know why the
indentation was all messed up...).

>> A couple more things:
>> 1) I thing that BOOST_PARAMETER_TEMPLATE_KEYWORD(ClassType) macro
>> should define a symbol _ClassType to be used for the named parameter
>> so to be consistent with the BOOST_PARAMETER_NAME(x) which defined _x
>> to be used for the named function parameter. However, ClassType is
>> defined without the leading _. What is the reason for this asymmetry?
>> 2) I'd expect a macro that allows to specify tag and passing argument
>> name for template parameters
>> BOOST_PARAMETER_TEMPLATE_KEYWORD((PassClassType, mytag) ClassType) as
>> for BOOST_PARAMETER_NAME((pass_x, mytag) x) does for function
>> parameters. Why is such a usage of BOOST_PARAMETER_TEMPLATE_KEYWORD
>> not supported?

--Lorenzo




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