fork download
  1. #include <iostream>
  2. #include <memory>
  3.  
  4. using namespace std;
  5.  
  6. class A{ };
  7.  
  8. void foo(A*)
  9. {
  10. // do something, or not, it is up to you...
  11. }
  12.  
  13. int main() {
  14. std::shared_ptr<A> sp(new A, foo);
  15. return 0;
  16. }
Success #stdin #stdout 0s 3268KB
stdin
Standard input is empty
stdout
Standard output is empty