fork download
  1. struct X { X(const X&) = delete; };
  2.  
  3. void demo(const X& m)
  4. {
  5. auto f = [m](){};
  6. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'void demo(const X&)':
prog.cpp:5:11: error: use of deleted function 'X::X(const X&)'
  auto f = [m](){};
           ^
prog.cpp:1:12: note: declared here
 struct X { X(const X&) = delete; };
            ^
prog.cpp:5:17: error: use of deleted function 'demo(const X&)::<lambda()>::<lambda>(demo(const X&)::<lambda()>&&)'
  auto f = [m](){};
                 ^
prog.cpp:5:13: note: 'demo(const X&)::<lambda()>::<lambda>(demo(const X&)::<lambda()>&&)' is implicitly deleted because the default definition would be ill-formed:
  auto f = [m](){};
             ^
prog.cpp:5:13: error: use of deleted function 'X::X(const X&)'
prog.cpp:1:12: note: declared here
 struct X { X(const X&) = delete; };
            ^
stdout
Standard output is empty