How to get the address of a static struct?

FoxyBrown via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jul 9 20:48:17 PDT 2017



static struct S
{
    public static:
         int x;
         string a;
}


....


auto s = &S; // ?!?!?! invalid because S is a struct, but...


basically s = S. So S.x = s.x and s.a = S.a;

Why do I have to do this?

Because in visual D, global structs don't show up in the 
debugger. So if I create a local alias, I can see see them, but I 
don't wanna have to do one variable for each variable in the 
struct...



More information about the Digitalmars-d-learn mailing list