Shopping for template languages

IchorDev zxinsworld at gmail.com
Wed Aug 14 15:23:45 UTC 2024


On Wednesday, 14 August 2024 at 15:03:44 UTC, user1234 wrote:
>> Now let’s try to use the same syntax for type-inferred struct 
>> constructors:
>> ```d
>> MyStruct s = (1, 2, 3);
>> ```
>> Oh look, a comma expression!
>
> Oh look, a tuple-exp implictly converted using structural 
> typing methods.

Hey, cool idea. We’re need to have tuples first, though.

> D does not parse the comma-exp anymore.

So how does this print 3?
```d
import std.stdio;

void main(){
   int n;
   n++, n++, n++;
   writeln(n);
}
```


More information about the Digitalmars-d mailing list