C++ Logo

std-discussion

Advanced search

Re: Explicit and implicit parameter counts

From: Rick C. Hodgin <rick.c.hodgin_at_[hidden]>
Date: Fri, 3 Sep 2021 11:16:21 -0400
The 1) and 2) options outlined in the initial post (for referencing
the passed in counts in code and being able to make logic decisions
with that information, and for conditional compilation).

IMO though, and most importantly, it completes the set of features
related to default parameter assignments.

-- 
Rick C. Hodgin
On 9/3/21, Oleksandr Koval <oleksandr.koval.dev_at_[hidden]> wrote:
> For something to be added in the standard there should be a good
> motivation, what's your motivation for this feature?
>
> On Fri, Sep 3, 2021 at 5:49 PM Rick C. Hodgin via Std-Discussion <
> std-discussion_at_[hidden]> wrote:
>
>> Greetings.
>>
>> Since we can define explicitly required parameters, and implicitly
>> required parameters (populated with default values), I'd like to
>> propose a way to know the number of each provided to a function by its
>> caller.
>>
>> This information would be available for use in two ways depending on
>> how it's referenced:
>>
>> (1) As add-on named function parameters for use as use variables (for
>> output, storage, or passing as parameters to other functions).  These
>> would be auto-added to the function's parameters by the compiler,
>> though invisible to the user unless an examination of the stack was
>> made:
>>
>> (2) As compile-time definitions which allow for conditional
>> compilation, which would ultimately create versions of a function
>> based on provided counts and the subsequent reference-only logic.
>>
>> [snip]
>>
>> --
>> Rick C. Hodgin
>> --
>> Std-Discussion mailing list
>> Std-Discussion_at_[hidden]
>> https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion
>>
>
>
> --
> Regards,
> Oleksandr Koval.
>

Received on 2021-09-03 10:16:23