fork download
  1. struct a {
  2. int operator+(char) {return 3;}
  3. };
  4.  
  5. int main() {
  6. a obj;
  7. decltype(obj+'z') result;
  8. result = obj + 'z';
  9. }
  10.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:7: warning: identifier ‘decltype’ will become a keyword in C++0x
prog.cpp: In function ‘int main()’:
prog.cpp:7: error: ‘decltype’ was not declared in this scope
prog.cpp:7: error: expected `;' before ‘result’
prog.cpp:8: error: ‘result’ was not declared in this scope
stdout
Standard output is empty