DIP 1030--Named Arguments--Community Review Round 1 Discussion

Patrick Schluter Patrick.Schluter at bbox.fr
Tue Feb 11 16:16:04 UTC 2020


On Tuesday, 11 February 2020 at 15:11:18 UTC, Arine wrote:
> On Sunday, 9 February 2020 at 20:59:52 UTC, Walter Bright wrote:
>> On 2/9/2020 11:51 AM, Arine wrote:
>>> struct A {
>>>     int foo;
>>> }
>>> 
>>> struct A {
>>>      int bar; // renamed from foo
>>>      deprecated alias foo = bar;
>>> };
>>> 
>>> 
>>> False equivalency, you have many tools at your disposal to 
>>> deal with this for structs.
>>
>>
>> C has it, too. Never heard a single complaint about it, either.
>>
>> https://en.cppreference.com/w/c/language/struct_initialization
>
> struct A {
>     int foo;
> };
>
> struct A {
>     union {
>         int foo;
>         int bar; // renamed to bar
>     };
> };

only since C11. anonymous unions and structs are gcc extension 
(or C++).

>
>
> struct A a = { .foo = 10 };
>
> False equivalency, you have some tools at your disposal to deal 
> with this for structs in C.




More information about the Digitalmars-d mailing list