fork download
  1. #include <iostream>
  2. #include <memory>
  3.  
  4. using p1 = std::unique_ptr<int>;
  5. using p2 = std::unique_ptr<int, void(*)(int*)>;
  6.  
  7. struct intdeleter {
  8. void operator()(int* t) const {
  9. delete t;
  10. }
  11. };
  12. using p3 = std::unique_ptr<int, intdeleter>;
  13.  
  14. int main()
  15. {
  16. std::cout << sizeof(p1) << " " << sizeof(p2) << " " << sizeof(p3) << std::endl;
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 5000KB
stdin
Standard input is empty
stdout
8 16 8