|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-11-13 17:51:30
Rene Rivera <grafik.list_at_[hidden]> writes:
> Daniel James wrote:
>
>> David Abrahams wrote:
>>
>>> This approach is superior to bgl_named_params in part because it
>>> avoids undue coupling and dependency in a library design. That
>>> coupling is discussed in depth in this excerpt from C++ Template
>>> Metaprogramming (http://www.boost-consulting.com/mplbook):
>> [snipped]
>> This coupling could be avoided by using an overloaded operator to
>> combine the arguments, for example:
>> f(slew(.799) | name("z"));
>> An advantage of this method is that it avoids the need for the
>> forwarding functions.
>
> I was just going over the library and have a related question. Is
> there a rational as to why the forwarding functions where used instead
> of overloading the "," operator?
What did you have in mind?
f(slew = .799, name = "z")
^
The comma above will never be treated as an operator. It's just the
way C++ works
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk