fork download
  1. void foo(bool b)
  2. {
  3. auto f0 = [&]{ return 5; };
  4.  
  5. auto f1 = [&]{ int i = 42; return i; };
  6.  
  7. auto f2 = [&]{
  8. int i = 0; double d = 3.14;
  9. if (b)
  10. return i;
  11. else
  12. return d;
  13. };
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In lambda function:
prog.cpp:12:20: error: inconsistent types 'double' and 'int' deduced for lambda return type
stdout
Standard output is empty