Struct Initialization syntax

Cym13 cpicard at openmailbox.org
Tue Jul 24 12:37:21 UTC 2018


On Tuesday, 24 July 2018 at 10:48:40 UTC, Dukc wrote:
> On Monday, 23 July 2018 at 16:26:42 UTC, Seb wrote:
>> What's your take on this?
>
> Option 2 won't necessarily cause problems with named funcion 
> arguments: The names of the constructor arguments and members 
> are different anyway, at least usually, letting the compiler to 
> infer the intended call by them.
>
> But there might be some corner cases where this would not 
> apply. Do you see any?

That argument sounds quite dangerous to me, especially since my 
experience is on the contrary that constructor arguments are 
often named the same as the attribute they refer to. And what of 
mixed cases? I really wouldn't rely on anything like naming 
conventions for something like that.


More information about the Digitalmars-d mailing list