Can we just have struct inheritence already?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Jun 10 14:54:06 UTC 2019


On Monday, 10 June 2019 at 14:42:41 UTC, Andrei Alexandrescu 
wrote:
> Nonsense. Again: the feature exists in C++ and is explicitly 
> forbidden by all coding standards. If they could turn the time 
> back they wouldn't have it. So... why would we now imitate it 
> alongside with its mistakes? If you have a great idea on how to 
> improve on it, sure. Otherwise, just don't.

Err... that claim makes no sense to me.

Just look at the implementation of the C++ standard library, it 
is used all over the place!  With multiple inheritance even. For 
good effect, actually. (Although I seldom use multiple 
inheritance myself.)

C++ makes no distinction between class and "struct", the slight 
difference is only for compatibility with C.

Do you really think that Bjarne Stroustrup would remove 
inheritance from C++?

That would be truly shocking…



More information about the Digitalmars-d mailing list