Shopping for template languages

user1234 user1234 at 12.de
Wed Aug 14 15:52:08 UTC 2024


On Wednesday, 14 August 2024 at 15:23:45 UTC, IchorDev wrote:
> 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);
> }
> ```

my bad, I thought it was at least deprecated ;)


More information about the Digitalmars-d mailing list