Because in the constructor of the base class I make sure the object gets registered with my entitymanager. Of course, I could call the function to add it to the registry in the constructor of the base class but I don't want to have to make the call to that function manually in every derived class.
Your example doesn't do the same.
In the BlitzMax example the constructor New() is first being run. After that you update the data member 'x'.
In the C++ example you pass the value for data member 'x' to the constructor of the base class. So the value of 'x' is known by the constructor of the base class.
Your example doesn't do the same.
In the BlitzMax example the constructor New() is first being run. After that you update the data member 'x'.
In the C++ example you pass the value for data member 'x' to the constructor of the base class. So the value of 'x' is known by the constructor of the base class.