#include <iostream>
using namespace std;
template <class Any>
void swap(Any &a, Any &b);
int main()
{
int c = 1;
int d = 2;
swap(c, d);
return 0;
}
template <class Any>
void swap(Any &a, Any &b)
{
cout << a << "and" << b << endl;
}
g++ -c main84.cpp
main84.cpp: In function ‘int main()’:
main84.cpp:11: ошибка: вызов перегруженной функции ‘swap(int&, int&)’ неоднозначен
main84.cpp:5: замечание: претенденты: void swap(Any&, Any&) [with Any = int]
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.1/../../../../include/c++/4.4.1/bits/move.h:76: замечание: void std::swap(_Tp&, _Tp&) [with _Tp = int]