Compiler output
prog.cpp: In function 'void swap(std::string&, std::string&)':
prog.cpp:27:8: error: reference to 'greater' is ambiguous
if (greater(b,a))
^
prog.cpp:19:6: note: candidates are: bool greater(std::string&, std::string&)
bool greater(string& a, string&b)
^
In file included from /usr/include/c++/4.9/string:48:0,
from /usr/include/c++/4.9/bits/locale_classes.h:40,
from /usr/include/c++/4.9/bits/ios_base.h:41,
from /usr/include/c++/4.9/ios:42,
from /usr/include/c++/4.9/ostream:38,
from /usr/include/c++/4.9/iostream:39,
from prog.cpp:2:
/usr/include/c++/4.9/bits/stl_function.h:358:12: note: template<class _Tp> struct std::greater
struct greater : public binary_function<_Tp, _Tp, bool>
^
prog.cpp: In function 'void solve(std::string)':
prog.cpp:88:14: error: reference to 'greater' is ambiguous
if (greater(bestDif,local))
^
prog.cpp:19:6: note: candidates are: bool greater(std::string&, std::string&)
bool greater(string& a, string&b)
^
In file included from /usr/include/c++/4.9/string:48:0,
from /usr/include/c++/4.9/bits/locale_classes.h:40,
from /usr/include/c++/4.9/bits/ios_base.h:41,
from /usr/include/c++/4.9/ios:42,
from /usr/include/c++/4.9/ostream:38,
from /usr/include/c++/4.9/iostream:39,
from prog.cpp:2:
/usr/include/c++/4.9/bits/stl_function.h:358:12: note: template<class _Tp> struct std::greater
struct greater : public binary_function<_Tp, _Tp, bool>
^