I think that question is not easy to answer. The effect is in both situations the same just the way it happans is different. In the one case function overloading is used and in the other case template specification.
But my question is. Would not it be a bad design to use a template for a function and than suddenly switch for a different type to function overloading. I mean let's assume you are using a third part library which defines the function isEqual() from the above example. Then you would use the whole time the library like this:
isEqual<int>(2,3);
isEqual<char>('a','b');
isEqual<double>(2.001,2.0);
If you would have used function overloading for double values the function which you have written to handle double values in a special would not be called but the template function:
template <class T>
boolean compareTo(T t1, T t2) { return t1 == t2; }
But now you run into the same problem like before. You wanted the double values to be equal when the Arithmetic precision is good enough. So you would write in the specification of your library now:
template <class T> boolean compareTo(...) : Use the template if you want to use any non double or float value. Otherwise see definition of: boolean compareTo(double a, double b);
In my opinion that would be a very bad design and would make your library less user friendly. So just use function overloading or templates. But do not mix these things up.
I mean you could let the whole time the compiler decide which function to pick. Then there would not be a difference again because function overloading is executed before the template functions. But still I would have a strange feeling because you would force the user to let the compiler pick the function and once someone uses the template like I above there woule be trouble again.
So to sum this up. I personally think it would be a bad design to mix up function overloading & templates. But may there is another person in the forum who can give me an example when/why it would be a good idea