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 foo. i is static, of course. I also want it to be __gshared.

Makes sense to me that

__gshared struct x;

all of x's variables should be __gshared.

struct Foo {
   __gshared:
       static int x;
       static float y;
}

Or:

struct Foo {
   __gshared {
      static int x;
      static float y;
   }
}

Reply via email to