What's the secret to static class members

Guido via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 29 08:18:53 PDT 2016


I'm using a static class member in a parent class, but can't get 
the compiler to see it.

Class Grid{
   public:
   uint xdim;
}

Class Holder : Grid {
   uint var;
}

Any of the following should work, but none of them do:
Grid.xdim = 0;

grid = new Grid;
grid.xdim = 0;

holder = new Holder;
holder.xdim = 0;

This is the way static class vars were intended to work. What 
magics have I forgotten?

Platform
DMD latest, Windows 7
Visual D


More information about the Digitalmars-d-learn mailing list