fork(2) download
  1. class Foo
  2. {
  3. public:
  4. const int n_;
  5. Foo();
  6. };
  7.  
  8. Foo::Foo()
  9. : n_( []() -> int { return 42; } )
  10. {
  11. }
  12.  
  13. int main()
  14. {
  15. Foo f;
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor 'Foo::Foo()':
prog.cpp:9:34: error: invalid conversion from 'int (*)()' to 'int'
stdout
Standard output is empty