DMD 2.100, bring ont he attribute soup

Nick Treleaven nick at geany.org
Fri May 27 09:43:02 UTC 2022


On Thursday, 26 May 2022 at 22:54:22 UTC, deadalnix wrote:
>
> If immutable instead meant immutable in most places, you you 
> can mutate it with this weird construct, then it is effectively 
> useless as a language construct, because it restrict my 
> expressiveness on one axis without granting me greater 
> expressiveness on another.

scope actually does allow that. Any local heap allocation only 
passed to scope parameters can be allocated on the stack instead 
of the heap.

void f(scope T);

T v = new T; // can be stack allocated
f(v);


More information about the Digitalmars-d mailing list