#pragma once #include namespace common { template class SharedPtr { public: SharedPtr() noexcept; SharedPtr(nullptr_t) noexcept; // NOLINT(google-explicit-constructor) explicit SharedPtr(Target *target) noexcept; SharedPtr(const SharedPtr &shared_ptr) noexcept; SharedPtr(SharedPtr &&shared_ptr) noexcept; ~SharedPtr() noexcept; [[nodiscard]] unsigned int reference_cnt() const noexcept; [[nodiscard]] bool is_disposable() const noexcept; SharedPtr &operator=(const SharedPtr &rhs) noexcept; SharedPtr &operator=(SharedPtr &&rhs) noexcept; Target &operator*() const noexcept; Target *operator->() const noexcept; private: Target *_target = nullptr; unsigned int *_reference_cnt; }; template SharedPtr make_shared(Args &&...args) noexcept; } // namespace common #include "shared_ptr.tpp"