fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class a {
  6. public: int i;
  7.  
  8. }
  9. a operator<< (a t, const int j) { t.i = j; return t; };
  10.  
  11.  
  12. int main() {
  13. cout<< (a()<<2).i ;
  14. return 0;
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:9: error: expected initializer before ‘operator’
prog.cpp: In function ‘int main()’:
prog.cpp:13: error: no match for ‘operator<<’ in ‘{0} << 2’
stdout
Standard output is empty