On Thursday, 15 October 2015 at 06:46:25 UTC, Ola Fosheim Grøstad wrote:
On Thursday, 15 October 2015 at 01:08:18 UTC, deadalnix wrote:
On Wednesday, 14 October 2015 at 20:12:52 UTC, Ola Fosheim Grøstad wrote:
[...]

No virtual dispatch, no downcast possible, no dynamic typeid, ...

Does this mean that static inheritance for structs can be done as syntax sugar using "alias this" with no semantic changes and get the same semantics as with a class?

E.g.:

struct MySub : MySuper {
}

translates into

struct MySub {
  MySuper __super;
  this(...){ __super.__ctor; ...}
  ~this(...){ ...; __super.__dtor;}
  alias __super this;
}

All I want from static inheritance is exactly what's made possible by the `models` PR. I guess I'll write that DIP after all.

Atila

Reply via email to