Boost logo

Boost :

From: mfdylan (dylan_at_[hidden])
Date: 2002-02-06 22:03:08


--- In boost_at_y..., "Noah Stein" <noah_at_v...> wrote:
>
>
> I like the idea of being able to accept default values anywhere one
is
> present. I think it would be preferable, though, to have an
explicit
> declaration of intent to use the default value instead of merely
omitting
> the argument. Since it is already a keyword, I would suggest using
> "default" to specify an argument of default value.
>
Perhaps both should be permitted. After all the only current way to
specify a default argument is to omit it, so it would seem reasonable
to allow omission for arguments other than the last.
The idea of named parameters is more interesting, but it's not
obvious how to do this for function calls, where parameter names can
be omitted, the operator = couldn't be used, and where parameter
names would be somehow injected into the callee's namespace:

int foo(int a, int b = 2, int c = 3);

void bar()
{
 int a, b, c, d;
 ...
 d = foo(a := a, c := 4);
}

But I guess other languages have this problem too...

Dylan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk