How would compete template specialization and matching functions ? like : double foo(double x) { return x * 2; } double foo(T)(T x) { return x * 3; } double foo(T : double)(T x) { return x * 4; } writeln(foo(4.0));