Timon Gehr wrote:
'typeof(this)' can be used to avoid stuttering the type at the mixin location.

mixin template Pool() { mixin Pool!(typeof(this)); }

class MyOtherClass {
    mixin Pool;
}

For some reason I was under the impression that typeof(this) couldn't be resolved in this situation (no 'this' value), but I'm sure you're correct here. Which of course means you'd need to "static if(isValueType!typeof(this)) { ... } else { ... }" to make it work with structs.


Reply via email to