diff options
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/Inputs/modernize-smart-ptr/unique_ptr.h')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/Inputs/modernize-smart-ptr/unique_ptr.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/Inputs/modernize-smart-ptr/unique_ptr.h b/clang-tools-extra/test/clang-tidy/Inputs/modernize-smart-ptr/unique_ptr.h new file mode 100644 index 00000000000..4fc3da106f6 --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/Inputs/modernize-smart-ptr/unique_ptr.h @@ -0,0 +1,28 @@ +namespace std { + +template <typename T> +class default_delete {}; + +template <typename type, typename Deleter = std::default_delete<type>> +class unique_ptr { +public: + unique_ptr(); + unique_ptr(type *ptr); + unique_ptr(const unique_ptr<type> &t) = delete; + unique_ptr(unique_ptr<type> &&t); + ~unique_ptr(); + type &operator*() { return *ptr; } + type *operator->() { return ptr; } + type *release(); + void reset(); + void reset(type *pt); + void reset(type pt); + unique_ptr &operator=(unique_ptr &&); + template <typename T> + unique_ptr &operator=(unique_ptr<T> &&); + +private: + type *ptr; +}; + +} // namespace std |