1 namespace std { 2 3 template <typename T> 4 class default_delete {}; 5 6 template <typename type, typename Deleter = std::default_delete<type>> 7 class unique_ptr { 8 public: unique_ptr()9 unique_ptr() {} unique_ptr(type * ptr)10 unique_ptr(type *ptr) {} 11 unique_ptr(const unique_ptr<type> &t) = delete; unique_ptr(unique_ptr<type> && t)12 unique_ptr(unique_ptr<type> &&t) {} ~unique_ptr()13 ~unique_ptr() {} 14 type &operator*() { return *ptr; } 15 type *operator->() { return ptr; } release()16 type *release() { return ptr; } reset()17 void reset() {} reset(type * pt)18 void reset(type *pt) {} reset(type pt)19 void reset(type pt) {} 20 unique_ptr &operator=(unique_ptr &&) { return *this; } 21 template <typename T> 22 unique_ptr &operator=(unique_ptr<T> &&) { return *this; } 23 24 private: 25 type *ptr; 26 }; 27 28 } // namespace std 29