C++ base constructor call vs. D's

Just Dave abcdef at 1234.com
Wed Oct 2 17:22:40 UTC 2019


I was reading the C++ to D page, and came across this little bit 
about when to call the base class constructor:

"It's superior to C++ in that the base constructor call can be 
flexibly placed anywhere in the derived constructor."

Isn't there some inherent danger of not calling the base 
constructor first? Wouldn't C++'s method actually be equal in the 
effect that you could just overwrite whatever value the base 
class set in the derived class?





More information about the Digitalmars-d-learn mailing list