fork download
  1. #include <algorithm>
  2.  
  3. template<class T>
  4. const T& myMax(const T& a, const T& b)
  5. {
  6. return (a < b) ? b : a;
  7. }
  8.  
  9. int main()
  10. {
  11. auto myMaxInt = myMax<int>;
  12. myMaxInt(1, 2);
  13.  
  14. auto stdMaxInt = std::max<int>;
  15. stdMaxInt(1, 2);
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:14:27: error: unable to deduce 'auto' from 'max<int>'
     auto stdMaxInt = std::max<int>;
                           ^
stdout
Standard output is empty