named arguments, string interpolation, please stop.

Hipreme msnmancini at hotmail.com
Thu Jan 11 13:46:26 UTC 2024


On Thursday, 11 January 2024 at 13:42:20 UTC, zjh wrote:

> Why can't we construct it directly like C++?
>
> ```d
> //C++ :
> A a = {
>    50,100
> };
> ```


We already have the function call syntax instead:
```d
A a = A(50, 100); //Does the same as C++ {} syntax
```
But this syntax is ugly and bad when you have a struct with 10+ 
members. This is where named arguments done a change for me.

Also, as Paolo said, one thing does not exclude the other by the 
way.


More information about the Digitalmars-d mailing list