
13 Nov
2004
13 Nov
'04
11:32 p.m.
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.