You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This "suggestion" isn't as much a suggestion as a "was it ever discussed and rejected for some reason (e.g. ABI problems, C++20 workaround considered decent enough, no agreement on syntax, etc...)?" because I didn't manage to find anything in the closed/open issues.
The text was updated successfully, but these errors were encountered:
@ILoveGoulash Thanks for the ping. Named arguments are a possible future direction as mentioned in the #193 (comment) link above, search for "designated initializers" (sorry that the comment it requires search, it got to be a long essay-length comment).
Meta comment to everyone: When opening suggestions, please do follow the Suggestion template and include the information it asks for. Thanks! Much appreciated.
Hello,
I should have nothing to say about the desirability of said feature, anyone who has ever felt the need for more than one optional parameter in C++ or used a language with them (Common Lisp, Julia, Python, Ruby, etc...) knows how it can clean up APIs and increase readability of call sites.
A quick web search shows the heavily boilerplate filled nature (and order restriction for the C++20 method) of the usual workarounds:
https://rosettacode.org/wiki/Named_parameters#C++
https://www.fluentcpp.com/2018/12/14/named-arguments-cpp/
https://pdimov.github.io/blog/2020/09/07/named-parameters-in-c20/
This "suggestion" isn't as much a suggestion as a "was it ever discussed and rejected for some reason (e.g. ABI problems, C++20 workaround considered decent enough, no agreement on syntax, etc...)?" because I didn't manage to find anything in the closed/open issues.
The text was updated successfully, but these errors were encountered: