On 15/03/2019 00:45, ag0aep6g via Digitalmars-d-learn wrote:
On 14.03.19 20:43, Jacob Carlborg wrote:
class C {
uint i ;
this (uint i) {
this.i = i ;
}
this (uint i) shared {
this.i = i ;
}
this (uint i) immutable {
this.i = i ;
}
}
On 14.03.19 20:43, Jacob Carlborg wrote:
class C {
uint i ;
this (uint i) {
this.i = i ;
}
this (uint i) shared {
this.i = i ;
}
this (uint i) immutable {
this.i = i ;
}
}
__gshared c0 = new C(0);
shared c1 = new shared C(1);
immuta
On 2019-03-14 12:05, spir wrote:
I desperately try to declare/define/initialise a simple class instance
at module-level. This is a special (conceptually static and immutable)
instance used as a "marker", that just should exist and be accessible by
methods of this class and/or other classes defi
On 14/03/2019 12:16, H. S. Teoh via Digitalmars-d-learn wrote:
On Thu, Mar 14, 2019 at 12:05:22PM +0100, spir via Digitalmars-d-learn wrote:
I desperately try to declare/define/initialise a simple class instance
at module-level. This is a special (conceptually static and immutable)
instance used
On Thursday, 14 March 2019 at 11:05:22 UTC, spir wrote:
I desperately try to declare/define/initialise a simple class
instance at module-level. This is a special (conceptually
static and immutable) instance used as a "marker", that just
should exist and be accessible by methods of this class an
On Thursday, 14 March 2019 at 11:05:22 UTC, spir wrote:
The most confusing error is:
Error: variable `_base.c0` is a thread-local class and cannot
have a static initializer. Use `static this()` to initialize
instead.
Error is reffering to:
https://dlang.org/spec/module.html#staticorder
Yo
On Thu, Mar 14, 2019 at 12:05:22PM +0100, spir via Digitalmars-d-learn wrote:
> I desperately try to declare/define/initialise a simple class instance
> at module-level. This is a special (conceptually static and immutable)
> instance used as a "marker", that just should exist and be accessible
> b
I desperately try to declare/define/initialise a simple class instance at
module-level. This is a special (conceptually static and immutable) instance
used as a "marker", that just should exist and be accessible by methods of this
class and/or other classes defined in the same module. (Thus I do