Topic: <None>
Author: jpsa@arc.ug.eds.com
Date: 10 May 93 12:26:18 GMT Raw View
In article <C6oqHB.Fvy@cbnewse.cb.att.com>, grumpy@cbnewse.cb.att.com (Paul J Lucas) writes:
> From article <1s8suj$kfb@network.ucsd.edu>, by joe@crl.ucsd.edu (Joe):
>>>Why are keyword function parameters not a part of C++
>>
>>> void func(int a=0, int b=0, int c=0);
>>> could be called as:
>>> func(c: 5, a: 3);
>>
(OTHER STUFF)
> Which is worse: remembering the argument order or remembering
> the keywords? The keywords should be optional; if they are,
> then in places where they're not used to call a function, you're
> back to remembering the argument order.
>
> Upshot: keyword arguments, in practice, are no help.
The big advantage comes when calling a function which takes a lot of
parameters which have default values. If you only want to override
one or two of them, then (at present) you have to re-specify the default
values for any which precede the ones which must be changed. With keyword
parameters, you need only specify the ones of interest.
> Also, it's just not worth the extra baggage of making C++ even
> bigger and complicating things for the (negligable) benefit.
Maybe. But they would be of more than negligable benefit.
John Aldridge
Author: grumpy@cbnewse.cb.att.com (Paul J Lucas)
Date: Mon, 10 May 1993 14:53:49 GMT Raw View