import std.stdio; class A { void f(T,U)(T t, U dummy) { writefln(t, ": call with sometype."); } void f(T:int,U)(T t, U dummy) { writefln(t,": call with int."); } } void main() { A a = new A; a.f("hoge", 0); a.f(1, 0); }
hoge: call with sometype.
1: call with int.
素直に書くだけ.