fork(22) download
  1. #include <iostream>
  2. #include <memory>
  3.  
  4. int main() {
  5. int x = 5;
  6. auto del = [](int * p) { std::cout << "Deleting x, value is : " << *p; };
  7. std::unique_ptr<int, decltype(del)> px(&x, del);
  8. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Deleting x, value is : 5