fork download
  1. #include <memory>
  2.  
  3. struct ObjType {
  4. };
  5.  
  6. static void freeaddrinfo(ObjType *)
  7. {
  8. }
  9.  
  10. int main(int,char**)
  11. {
  12. auto deleter =
  13. [](ObjType *ptr){
  14. if (ptr!=nullptr) { freeaddrinfo(ptr); }
  15. };
  16. std::unique_ptr<ObjType,decltype(deleter)> ptr(new ObjType,deleter);
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 2980KB
stdin
Standard input is empty
stdout

Standard output is empty