Comment #0 by alphaglosined — 2024-10-12T13:11:41Z
A nice optimization to have is to allocate memory on the stack when it is scope.
This is applied for classes, but not structs.
https://dlang.org/spec/attribute.html#scope-class-var
```d
struct S {
}
scope s = new S; // heap allocated
```
Comment #1 by aldacron — 2024-10-13T08:13:30Z
What would be the point of that? Why would anyone want to do that instead of
S s;
?
Comment #2 by robert.schadek — 2024-12-13T19:38:02Z