|
Boost : |
From: David Abrahams (abrahams_at_[hidden])
Date: 2001-04-05 19:14:51
----- Original Message -----
From: "Ullrich Koethe" <u.koethe_at_[hidden]>
> > Okay, you can do that, usually at the cost of usability for the
client...
>
> I'm not sure if usablility is so bad, especially in the keyword variant.
> I keep forgetting the argument order even for my own functions. Keywords
> would solve this (as long as I remember them :-). Also, they give much
> more powerful default value capabilities than C++ otherwise has.
>
> I'm using a similar technique in the vigra library:
>
> transform(srcImageRange(in1), srcImage(in2), destImage(out), Functor());
>
> where srcImageRange() etc. are factories for argument tuples (of fixed
> length in this case). This greatly improves readability.
Don't worry, I appreciate the value of having keyword arguments. See the
iterator adaptors library.
> > but it still doesn't handle the const/non-const reference combinatorics
> > problem.
>
> What exactly is this problem? Can it be solved by explicitly
> specializing the list() factory?
>
> list<Foo &>(aFoo) vs.
> list<Foo const &>(aFoo)
Sure, but not transparently. Now you're requiring users to name the full
type of the parameter when they call the forwarding function.
-Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk