fork download
  1. struct X{
  2. };
  3.  
  4. bool operator>(X& a, int& b){ return true; }
  5.  
  6. template<class T>
  7. auto operator<(T const& v, int&&) -> decltype(v > int()){ return true; }
  8.  
  9. int main(void) {
  10. X x;
  11. x < 6;
  12. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:11:7: error: no match for 'operator<' in 'x < 6'
stdout
Standard output is empty