typeof(this) return wrong type

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Apr 22 05:52:16 PDT 2017


On Saturday, 22 April 2017 at 12:23:32 UTC, Basile B. wrote:
> use a "template this" parameter:

I think the nicest way to do it is to use the template this 
parameter in the constructors, since that's the one function that 
you can guarantee is always called on the most derived type.

Of course, you can still forget to call it in a child class..



More information about the Digitalmars-d-learn mailing list