Can we just have struct inheritence already?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jun 10 07:26:29 UTC 2019


On 6/9/19 5:13 PM, Manu wrote:
> This is NOT polymorphism, we're not talking about polymorphism, I wish
> people would not change the topic.

The problem here is that it's difficult to define subtyping without 
polymorphism. C++ does technically allow it, but code such as:

struct my_vector : public std::vector<int> { ... }

is universally reviled. I really think it wouldn't help D much to add 
struct inheritance.


More information about the Digitalmars-d mailing list