prog.cpp: In function ‘int main()’:
prog.cpp:28:17: error: call of overloaded ‘max(box&, box&)’ is ambiguous
b = max(b, c);
^
prog.cpp:19:17: note: candidate: ‘T max(T, T) [with T = box]’
template <> box max<box>(box a, box b) {
^~~~~~~~
In file included from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/ios:40,
from /usr/include/c++/8/ostream:38,
from /usr/include/c++/8/iostream:39,
from prog.cpp:2:
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: candidate: ‘constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = box]’
max(const _Tp& __a, const _Tp& __b)
^~~
prog.cpp:29:23: error: call of overloaded ‘max(int&, int&)’ is ambiguous
cout << max(i1, i2) << endl;
^
prog.cpp:16:3: note: candidate: ‘T max(T, T) [with T = int]’
T max(T a, T b) {
^~~
In file included from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/ios:40,
from /usr/include/c++/8/ostream:38,
from /usr/include/c++/8/iostream:39,
from prog.cpp:2:
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: candidate: ‘constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]’
max(const _Tp& __a, const _Tp& __b)
^~~