On Friday, 14 September 2018 at 08:18:25 UTC, Arafel wrote:
shared synchronized class A {private Unshared!S s; // Should this even be possible? What about the @disable this?? // I would expect at least one, if not both of the following, to work//private Unshared!S s2 = S(1); //private Unshared!S s3 = 1;this(){ s = S(1); //s = 1; s.f; } void f() { writeln(s.i); } }
You can do private Unshared!(S*) s; this(){ s = new S(1); }