Date: Mon, 5 Jan 2026 10:03:57 +0100
Designated initializers need the struct to be an aggregate. That is all member variables are public and can be used for access after construction.
The same is not true for parameter names of declared functions.
So the opt-in is not fully comparable.
One would need (to make it comparable):
void foo(int positional, public bool named);
Or even require all parameters to be public (as is the case for designated initializers).
-----Ursprüngliche Nachricht-----
Von:Jan Schultke via Std-Proposals <std-proposals_at_[hidden]>
Gesendet:Mo 05.01.2026 09:37
Betreff:Re: [std-proposals] Labelled parameters
An:Ville Voutilainen <ville.voutilainen_at_[hidden]>;
CC:Jan Schultke <janschultke_at_[hidden]>; std-proposals_at_[hidden];
EWG has rejected proposals like
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4172.htm
before due to the (lack of) opt-in question.
I don't see how anything has changed in that regard.
I'm aware of the previously rejected proposals, and have read the minutes on those. I don't think that the past proposals failed solely due to the opt-in question. It was a combination of factors, including not having a working implementation and not dealing with the design questions thoroughly enough.
Historically, we also didn't have designated initializers (which don't require the struct to opt in explicitly), and we didn't have parameter name reflection (which faces the exact same issue of possible inconsistencies between declarations). The rest of the language has changed quite significantly since 2014. IIRC at least 50% of the backlash to N4172 was due to the parameter name inconsistency problem, and that's now addressed (though not really solved) elsewhere.
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2026-01-05 09:19:35
