__gshared as part of alias

Nicholas Wilson iamthewilsonator at hotmail.com
Fri Jan 12 04:25:25 UTC 2018


Is there a way to make __gshared part of an alias?

as in

enum AddrSpace : uint
{
     Private  = 0,
     Global   = 1,
     Shared   = 2,
     Constant = 3,
     Generic  = 4,
}

struct Variable(AddrSpace as, T)
{
     T val;
     alias val this;
}
alias Global(T)   = __gshared Variable!(AddrSpace.Global,   T);

Global!float bar1; // <- still thread local


More information about the Digitalmars-d-learn mailing list