C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Explicit default parameters with the keyword default
From: Edward Diener (eldlistmailingz_at_[hidden])
Date: 2020-12-29 12:39:33


On 12/29/2020 1:35 PM, sasho648 via Std-Proposals wrote:
> Hello so I have some functions that I want to specify for example the
> very last argument but there are default parameter preceding it that I
> don't want to touch. I suggest to allow the use of the `default` keyword
> to fill those with their default values. Here is an example:
>
> int func(int a, int b = 6, int c = 7, int d = 8);
>
> Here I want to only set the last d parameter without touching the b and
> c, leaving them default so my call would look something like this:
>
> func(a, default, default, 10);
>
> I hope you understand what my suggestion is and its purpose.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1466.pdf

>
> Thanks.
>


STD-PROPOSALS list run by std-proposals-owner@lists.isocpp.org

Standard Proposals Archives on Google Groups