Stroustrup is disappointed with D :(

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 23 02:09:51 PDT 2015


On Wednesday, 23 September 2015 at 08:27:43 UTC, ponce wrote:
> I fail to see how the multi-part C++ object initialization is 
> any better than the one of D.
> It just is very simple in D: first assign .init, then call the 
> destructor, virtual calls allowed (of course!).

The combination of being able to override most member functions 
and them being called in super constructors makes for a brittle 
inheritance mechanism. If virtual was explicit and the superclass 
could make some parts of the virtual function non-overridable 
then it would be less problematic.

> The weird rules of virtual functions in ctor/dtor in C++ just 
> feel like one more special case. It doesn't even seem more 
> efficient, quite the contrary.

Devirtualized inlining is trivially more efficient than virtual 
calls...


More information about the Digitalmars-d mailing list