Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-11-13 18:32:05


Daniel Wallin wrote:
> Peter Dimov wrote:
>> Daniel James wrote:
>>
>>>
>>> This coupling could be avoided by using an overloaded operator to
>>> combine the arguments, for example:
>>>
>>> f(slew(.799) | name("z"));
>>
>>
>> I've been using essentially the same technique, except that I chose
>> & as a combiner operator. | isn't bad, too.
>
> But it still looks considerably worse than:
>
> f(slew = 0.799, name = "z");
>
> And you lose the positional meaning.

Yes, I use it in a slightly different context, to pass arbitrary argument
tuples via an A const & a templated argument, not as a replacement to
ordinary positional calls. The callee then queries 'a' for 'name', for
example, if it supports a 'name' attribute. The set of attributes isn't
fixed.


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