Is `alias this` a mistake?

jmh530 john.michael.hall at gmail.com
Thu Aug 5 15:49:25 UTC 2021


On Wednesday, 4 August 2021 at 16:45:27 UTC, H. S. Teoh wrote:
> [snip]
>
> This is why, even though I loved alias this (and still do to 
> some extent), I have come to realize that in the long term, it 
> lies more on the negative side of the scale than the positive.
>
>
> T

Goods points throughout. Thanks for your perspective.

You describe an issue with upcasting. Would something like this 
only work in the context of classes and reference types? In other 
words, suppose alias this was removed from the language, but some 
more formal inheritance scheme was introduced for structs. Would 
it be able to have that behavior?


More information about the Digitalmars-d mailing list