Asserting that a base constructor is always called

Tim t.oliver at windowslive.com
Sat May 23 22:04:29 UTC 2020


I have a base class GameObject:

/// Base class of most objects in the game
class GameObject{
     this(){
         world[layer] = this;
     }

     abstract void update(){}

     void draw(){}
}

I want to make sure that whenever a class inherits from this, the 
base constructor is always called. Either that or have an 
assertion that gives an error if it isn't called.

Thanks


More information about the Digitalmars-d-learn mailing list