fork download
  1. #include <cstdio>
  2. #include <iostream>
  3. #include <memory>
  4.  
  5. struct A
  6. {
  7. A() { std::cout << "A" << std::endl; }
  8. ~A() { std::cout << "~A" << std::endl; }
  9.  
  10. };
  11.  
  12. int main(void) {
  13. auto a = std::make_shared<A>();
  14. {
  15. auto f = [&a]() {};
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0s 5356KB
stdin
Standard input is empty
stdout
A
~A