fork download
  1. #include <iostream>
  2.  
  3. class foo
  4. {
  5. public:
  6. int val;
  7.  
  8. foo (int i) : val(i) {}
  9.  
  10. bool foo::operator < (const foo &other)
  11. {
  12. return val < other.val;
  13. }
  14. };
  15.  
  16.  
  17. int main()
  18. {
  19. foo f(5), g(4);
  20. std::cout << std::boolalpha << (f < g) << '-' << (g < f);
  21. }
  22.  
  23.  
  24.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:10:11: error: extra qualification ‘foo::’ on member ‘operator<’ [-fpermissive]
stdout
Standard output is empty