Is this actually supposed to be legal?
Chris NS
ibisbasenji at gmail.com
Mon Jul 16 23:49:03 PDT 2012
It is indeed supposed to work, and was actually touted as a
common and lauded example way back in the day. However, with the
advent of this-params for templates it seems less useful now
(once they've been through the ringer a little more at least).
I did use this-params to great effect in Zeal, to auto-inject
behavior into subclasses with the proper scoping and other
concerns. The base class didn't even have to be a template
itself (just the magical internals).
https://github.com/csauls/zeal.d/blob/master/source/zeal/base/controller.d
So, to repeat, yes it is supposed to work... but I'm not so sure
it is such a good idea anymore -- assuming this-params will work
on the class declaration.
-- Chris NS
More information about the Digitalmars-d-learn
mailing list