On Saturday, 23 July 2016 at 21:44:05 UTC, Rufus Smith wrote:
Templates are not the end all be all. They don't allow for run-time polymorphism, which is an important aspect of software.
Ok, so you need runtime polymorphism. And you want it in @nogc code. That's not difficult. Just have the base class of your hierarchy declare its opXXX @nogc. This is possible, because non-@nogc functions can be overridden by @nogc ones (as logical). Now you can have your function accept parameters of your base class, and it will be @nogc. And without forcing every class of the D world to have opXXX @nogc.
I don't see why this wouldn't be enough...