[C++-sig] default arguments
Ralf W. Grosse-Kunstleve
rwgk at yahoo.com
Thu May 23 18:28:36 CEST 2002
--- David Abrahams <david.abrahams at rcn.com> wrote:
> It would be nice, wouldn't it? However, there's no way to make the C++ code
> you wrote do that. Once you take the address of a function all information
> about its default args is lost. Default argument support will take some
> work from you, and some from me. In other words, there's no support for it
> in the library yet, but even when it's there, you'll need to write some
> more code to take advantage of it.
>
> For the time being, you can use 3 thin wrapper functions which call
> testInteger:
>
> int testInteger1(int i1, int i2, int i3, int i4) {
> return testInteger(i1,i2,i3,i4);
> }
>
> int testInteger2(int i1, int i2, int i3) {
> return testInteger(i1,i2,i3);
> }
>
> int testInteger3(int i1, int i2) {
> return testInteger(i1,i2);
> }
A large fraction of my Boost.Python V1 code consists of this kind of thin
wrappers. It is a real nuisance. What is the expected time of arrival for the
improved support for default arguments? Any chance this happens before next
week? <wink>
Thanks,
Ralf
__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
More information about the Cplusplus-sig
mailing list