Re: static __gshared struct

2016-07-02 Thread Hiemlick Hiemlicker via Digitalmars-d-learn
On Saturday, 2 July 2016 at 03:54:26 UTC, Mike Parker wrote: On Saturday, 2 July 2016 at 00:08:10 UTC, Hiemlick Hiemlicker wrote: I use a struct with static members so I do not have to instantiate it. It is essentially a singleton. I want all the variables to be __gshared. I guess I have to

Re: static __gshared struct

2016-07-01 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 2 July 2016 at 00:08:10 UTC, Hiemlick Hiemlicker wrote: I use a struct with static members so I do not have to instantiate it. It is essentially a singleton. I want all the variables to be __gshared. I guess I have to prefix all variables with it? Basically I have Foo.i; on f

Re: static __gshared struct

2016-07-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 2 July 2016 at 00:08:10 UTC, Hiemlick Hiemlicker wrote: On Friday, 1 July 2016 at 23:36:35 UTC, Basile B. wrote: On Friday, 1 July 2016 at 23:26:19 UTC, Hiemlick Hiemlicker wrote: On Friday, 1 July 2016 at 23:03:17 UTC, Basile B. wrote: [...] Ok, Does that mean [...]

Re: static __gshared struct

2016-07-01 Thread Hiemlick Hiemlicker via Digitalmars-d-learn
On Friday, 1 July 2016 at 23:36:35 UTC, Basile B. wrote: On Friday, 1 July 2016 at 23:26:19 UTC, Hiemlick Hiemlicker wrote: On Friday, 1 July 2016 at 23:03:17 UTC, Basile B. wrote: On Friday, 1 July 2016 at 22:47:21 UTC, Hiemlick Hiemlicker wrote: Ok, Does that mean void main() { static

Re: static __gshared struct

2016-07-01 Thread Basile B. via Digitalmars-d-learn
On Friday, 1 July 2016 at 23:26:19 UTC, Hiemlick Hiemlicker wrote: On Friday, 1 July 2016 at 23:03:17 UTC, Basile B. wrote: On Friday, 1 July 2016 at 22:47:21 UTC, Hiemlick Hiemlicker wrote: Ok, Does that mean void main() { static struct Foo{} foo(); } void foo() { Foo f; }

Re: static __gshared struct

2016-07-01 Thread Hiemlick Hiemlicker via Digitalmars-d-learn
On Friday, 1 July 2016 at 23:03:17 UTC, Basile B. wrote: On Friday, 1 July 2016 at 22:47:21 UTC, Hiemlick Hiemlicker wrote: what exactly does this do? are all members _gshared? In this case __gshared is a complete NOOP. __gshared has only an effect on variables. It prevents them to reside in

Re: static __gshared struct

2016-07-01 Thread Basile B. via Digitalmars-d-learn
On Friday, 1 July 2016 at 22:47:21 UTC, Hiemlick Hiemlicker wrote: what exactly does this do? are all members _gshared? In this case __gshared is a complete NOOP. __gshared has only an effect on variables. It prevents them to reside in the TLS, so that they can be used by any thread of the pr