fork download
  1. auto func = [](bool doit)->void {
  2. if (doit) {
  3. } else {
  4. }
  5. };
  6.  
  7. switch (something) {
  8. case 1:
  9. func(a);
  10. break;
  11. case 2:
  12. func(c);
  13. break;
  14. }
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1: error: ISO C++ forbids declaration of ‘func’ with no type
prog.cpp:1: error: top-level declaration of ‘func’ specifies ‘auto’
prog.cpp:1: error: expected primary-expression before ‘[’ token
prog.cpp:1: error: expected primary-expression before ‘]’ token
prog.cpp:1: error: expected primary-expression before ‘bool’
prog.cpp:1: error: expected unqualified-id before ‘void’
prog.cpp:1: error: expected ‘,’ or ‘;’ before ‘void’
stdout
Standard output is empty