prog.cpp: In function ‘int main()’:
prog.cpp:15:29: error: no matching function for call to ‘min(main()::A&, main()::A&)’
auto c = min(a,b);// here is another error
^
prog.cpp:15:29: note: candidate is:
prog.cpp:2:14: note: template<class T> decltype (((a < b), a)) min(T, T)
auto min(T a, T b ) ->decltype(a<b, a)
^
prog.cpp:2:14: note: template argument deduction/substitution failed:
prog.cpp: In substitution of ‘template<class T> decltype (((a < b), a)) min(T, T) [with T = main()::A]’:
prog.cpp:15:29: required from here
prog.cpp:2:41: error: no match for ‘operator<’ (operand types are ‘main()::A’ and ‘main()::A’)
auto min(T a, T b ) ->decltype(a<b, a)
^
prog.cpp:12:18: warning: unused variable ‘x’ [-Wunused-variable]
auto x = min( 2, 3 ) ;// success
^