What is the shortest way to define an immutable token of unique type?

Per Nordlöw per.nordlow at gmail.com
Mon Mar 15 09:45:44 UTC 2021


On Sunday, 14 March 2021 at 16:37:58 UTC, Andrei Alexandrescu 
wrote:
> struct Hex {}
> immutable Hex hex;

What about making the type name optional (via a language change) 
and allow

     immutable struct { int x; int y; } hex;

and if possible have it be lowered to a builtin tuple

     immutable (int, int) hex;

?

Does a struct and tuple with the same fields have the same memory 
layout?


More information about the Digitalmars-d mailing list