prog.cpp: In instantiation of ‘const T& max(const T&, const T&, const T&) [with T = int]’:
prog.cpp:26:33: required from here
prog.cpp:21:24: error: call of overloaded ‘max(const int&, const int&)’ is ambiguous
return max (max(a,b), c);
^
prog.cpp:21:24: note: candidates are:
prog.cpp:6:17: note: const T& max(const T&, const T&) [with T = int]
inline T const& max (T const& a, T const& b)
^
prog.cpp:12:20: note: const char* max(const char*, const char*) <near match>
inline char const* max (char const* a, char const* b)
^
prog.cpp:12:20: note: no known conversion for argument 2 from ‘const int’ to ‘const char*’
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
from /usr/include/c++/4.8/ios:40,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from prog.cpp:2:
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]
max(const _Tp& __a, const _Tp& __b)
^
prog.cpp: In function ‘const T& max(const T&, const T&, const T&) [with T = int]’:
prog.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^