On 25/06/2024 2:16 PM, mw wrote:
struct shared_AA {shared_AA_class saa = new shared_AA_class(); // by this syntax `saa` is still instance variable?alias saa this; }
When you specify an initializer like this, that instance of ``shared_AA_class`` gets put into the .init of ``shared_AA``.
It is shared between instances, even if its a field. ```d import std.stdio; struct Foo { ubyte value = 2; } void main() { writeln(cast(ubyte[])__traits(initSymbol, Foo)); // [2] } ```