Call to templated function is ambiguous when using float
Hello, I have this function:
Code:
template <typename T>
void swap (T& arg1, T& arg2) {
T& tmp = arg1;
arg1 = arg2;
arg2 = tmp;
}
When I make a call it passing float arguments, like here:
Code:
if (tmin > tmax) swap(tmin, tmax);
, I receive:
Code:
/media/34GB/demos/asmfrt/Bbox.h|29|error: call of overloaded ‘swap(float&, float&)’ is ambiguous|
Code:
/media/34GB/demos/asmfrt/Miscellaneous.h|44|note: candidates are: void swap(T&, T&) [with T = float]|
How can this be treated? Thanks in advance.