mixin template MyMixin() { void foo(int) { } } struct A { void foo() { } mixin MyMixin; } int main(string[] args) { A a; a.foo(5); return 0; } Error: function hello.A.foo () is not callable using argument types (int)
That is how it is supposed to work. "Mixin Scope The declarations in a mixin are ‘imported’ into the surrounding scope. If the name of a declaration in a mixin is the same as a declaration in the surrounding scope, the surrounding declaration overrides the mixin one" dlang.org/template-mixin.html You can use a string mixin to generate overloads.