|
Boost : |
From: Thomas Witt (witt_at_[hidden])
Date: 2004-11-23 01:21:19
Hi,
I was going to provide a (late) review for the named parameter lib, but
I have some questions before I can do that.
1) I find the use of the name "keyword" for the type of the named
parameter somehow odd. It does not seem to fit with what I associate
with keywords. What's the rationale behind that choice.
2) The docs give the following example for mixing named and positional
parameters:
foo("bar", 3.14f);
foo(value = 6.28f, "baz")
Should print:
bar = 3.14
baz = 6.28
I believe the parameter deduction in this case is too smart. Is there a
way for the user of the library to enforce a rule like "No positional
param after named params" on a case by case basis?
3) Section 5 has the following example
// implementation of bar()
template <class Params>
void bar_impl(Params const& params)
{
// Extract arguments
float x_ = params[x];
float theta_ = params[theta | pi];
float span = params[span || boost::bind(default_span, x_, theta_)];
//!! ^^^^ ^^^^
...
}
IIUC this does not work. I assume the second span should refer to a
named paramter object. I think it refers to the local span object.
Did I miss something?
Regards
Thomas
PS: Doug I know I am late, feel free to ignore me.
-- Thomas Witt witt_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk