It seems your template has problems with this: struct A { } class B { public: const int bar(ref A a) { return 42; } mixin(rvalue!(bar)); } remove the 'const' and it works fine.