Dynamic templated virtuals - I still often want them

zjh fqbqrr at 163.com
Sat Mar 12 15:06:58 UTC 2022


On Saturday, 12 March 2022 at 05:10:10 UTC, surlymoor wrote:
> On Thursday, 23 July 2020 at 02:38:27 UTC, Adam D. Ruppe wrote:
>> You might know about D's template this parameters, which adapt


Each class should have a `This` type or information like rust's 
`self/Self` to indicate `Self Type`.
`The base class` should have a special `This` template parameter. 
As long as subclass inherits it, `the subclass` will 
automatically replace `This` as itself Type.
In fact, it once again shows the `benefits` of `inheritance`.
`Struct` should be able to inherit, or even multi inheritation 
like `C++`.



More information about the Digitalmars-d mailing list