Date: Wed, 6 Oct 2021 13:25:52 -0400
Good point, I forgot about designated initializers.
On 10/6/21 12:34 PM, Giuseppe D'Angelo via Std-Proposals wrote:
> Il 06/10/21 18:03, Phil Bouchard via Std-Proposals ha scritto:
>> What I suggest is to add a prefix that could replace: "this->"
>>
>> void A::foo(int & var)
>>
>> {
>>
>> var = 1; // changes parameter
>>
>> .var = 2; // changes member variable
>>
>> }
>>
>
> This specific syntax is taken by designated initializers. In
>
> void A::foo()
> {
> B b{ .var = 42 };
> };
>
> are you initializing the `var` data member of B via aggregate init, or
> assigning 42 to this->var and then using some other form of init for B?
>
> That having been said, I'd hardly claim that this is a "major" problem
> deserving its own syntax; renaming the parameter or the member
> variables following proper code conventions sounds like a better idea
> anyways.
>
> My 2 c,
>
On 10/6/21 12:34 PM, Giuseppe D'Angelo via Std-Proposals wrote:
> Il 06/10/21 18:03, Phil Bouchard via Std-Proposals ha scritto:
>> What I suggest is to add a prefix that could replace: "this->"
>>
>> void A::foo(int & var)
>>
>> {
>>
>> var = 1; // changes parameter
>>
>> .var = 2; // changes member variable
>>
>> }
>>
>
> This specific syntax is taken by designated initializers. In
>
> void A::foo()
> {
> B b{ .var = 42 };
> };
>
> are you initializing the `var` data member of B via aggregate init, or
> assigning 42 to this->var and then using some other form of init for B?
>
> That having been said, I'd hardly claim that this is a "major" problem
> deserving its own syntax; renaming the parameter or the member
> variables following proper code conventions sounds like a better idea
> anyways.
>
> My 2 c,
>
-- Email Signature Logo <https://www.fornux.com/> *Phil Bouchard* facebook icon <https://www.linkedin.com/in/phil-bouchard-5723a910/> CTO T: (819) 328-4743 E: phil_at_[hidden]| www.fornux.com <http://www.fornux.com> 1188 rue Saint-Louis| Gatineau (Qc), J8T 2L8 Canada Banner <https://goglobalawards.org/> Le message ci-dessus, ainsi que les documents l'accompagnant, sont destinés uniquement aux personnes identifiées et peuvent contenir des informations privilégiées, confidentielles ou ne pouvant être divulguées. Si vous avez reçu ce message par erreur, veuillez le détruire. This communication (and/or the attachments) is intended for named recipients only and may contain privileged or confidential information which is not to be disclosed. If you received this communication by mistake please destroy all copies.
Received on 2021-10-06 12:25:57