On Tuesday, 14 October 2014 at 20:58:19 UTC, tcak wrote:
I have written a struct and a mixin template, and that mixin template is mixed into that struct as follows.


Use a normal mixin + token strings(q{}).

enum TestCommonMethods = q{
        public bool apply( int d, int e ){
                return false;
        }
};

public struct Test{
        mixin(TestCommonMethods);

        public bool apply(char c){
                return true;
        }
}

void main(){
        Test t;
        t.apply( 5, 3 );
}

Reply via email to