Can we just have struct inheritence already?

Timon Gehr timon.gehr at gmx.ch
Thu Jun 13 12:03:06 UTC 2019


On 13.06.19 08:43, Manu wrote:
> What are we so afraid of? I don't understand the resistance to this
> *at all*...

I think a lot of the default opposition to new features (especially if 
they can be implemented with a moderate amount of user code) is about 
DMD compiler complexity, about adding new things to a code base which 
already suffers quite a bit from incidental complexity. (E.g., I learned 
last week that there are multiple different ways to infer function 
attributes. Some of them are quite broken, but I wasn't able to get rid 
of the special and broken `pure` inference without breaking the test 
suite, within the allotted time.)

> people talk about slicing, which is a pretty worthless
> baseline argument; it's totally possible in C++ and I've never heard a
> single case of anyone ever having that problem in my life, at work, at
> home, or even on the internet (yes, I'm sure I would find if I
> deliberately went looking). I'm only aware the concept has a name
> because I've seen it written in a book somewhere. It's 99.9999%
> not-even-remotely-a-problem, it's only a 'theoretical' problem.
> ...

Slicing is only a problem if you have a vtable.


More information about the Digitalmars-d mailing list