template this parameters

Simen kjaeraas simen.kjaras at gmail.com
Tue Jan 25 07:55:08 PST 2011


Trass3r <un at known.com> wrote:

> Why do they exist and why does typeof(this) strip constness?

Template this parameters allow for covariant return types, that's about
all the use cases I've found for it. It seems like such a great thing,
almost doing automatic overriding of methods in subclasses, but that's
not what it does.

As for typeof(this), that sounds like a bug.

-- 
Simen


More information about the Digitalmars-d-learn mailing list