#include <iostream> using namespace std; class a { public: int i; } a operator<< (a t, const int j) { t.i = j; return t; }; int main() { cout<< (a()<<2).i ; return 0; }
Standard input is empty
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’
Standard output is empty