Hello,

Consider the following silly, but illustrative example:
***********************************************
mixin template HasValue(ContainingType)
{
    uint value = ContainingType.outerValue;
}

struct MyStruct
{
    uint outerValue;

    mixin HasValue!(typeof(this));
}
***********************************************


Now what if I wanted to use that mixin in a module:
***********************************************
module myModule;

uint outerValue;

mixin HasValue!(typeof({what?}); //how do I refer to the module type there is no 'this' for modules
************************************************

Basic question: How can I have my mixin refer to the type it's mixing into, and have it work regardless of whether it's mixing into a module or a class/struct?

Thanks for the help,
Mike

Reply via email to