Why can't we derive struct's?

Walter Bright newshound2 at digitalmars.com
Thu Dec 20 03:42:08 UTC 2018


On 12/19/2018 5:40 PM, Manu wrote:
> I've long since become bored of this design decision. Is there good
> reason for it?

`alias this` can alias to a function, that doesn't work very well with the base 
class syntax (you also use alias this to a function).

> Why should it be impossible to derive a struct?

Because polymorphism makes little sense for a value type.

 > static if (Base.tupleof.length == 0)

static if (Base.sizeof == 0)

 > then the derived class

class? struct? Dessert topping? Floor wax?

https://www.youtube.com/watch?v=wPO8PqHGWFU
(too bad youtube pulled the video part, it's just audio)


More information about the Digitalmars-d mailing list