
13 Nov
2004
13 Nov
'04
11:12 p.m.
David Abrahams wrote:
Daniel James <daniel@calamity.org.uk> writes:
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.
You could also write
(slew = .799) | (name = "z")
Or: f((slew = .799, name = "z")); With the current library. -- Daniel Wallin