55 T* operator->()
const noexcept;
56 T& operator*()
const noexcept;
62 T*
get()
const noexcept;
68 explicit operator bool()
const noexcept;
77 bool operator==(
const U& other)
const noexcept;
86 std::strong_ordering
operator<=>(
const U& other)
const noexcept;
93 lock_ptr(std::shared_ptr<T> pShared) noexcept;
96 std::shared_ptr<T> m_pRaw;
100 link() noexcept = default;
108 link(const std::weak_ptr<U>& pWeak) noexcept;
114 link(std::weak_ptr<T> pWeak) noexcept;
122 link(const std::shared_ptr<U>& pStrong) noexcept;
127 link(std::shared_ptr<U>&& pStrong) noexcept = delete;
135 link(const
link<U>& pLink) noexcept;
167 link(std::nullptr_t) noexcept;
178 void reset() noexcept;
190 explicit operator
bool() const noexcept;
193 bool operator==(const
link<U>&) const noexcept = delete;
195 bool operator!=(const
link<U>&) const noexcept = delete;
198 std::weak_ptr<T> m_pWeak;
203 #include <qx/smart_ptr/link.inl>
T * get() const noexcept
Get object pointer.
bool operator==(const U &other) const noexcept
operator==
std::strong_ordering operator<=>(const U &other) const noexcept
operator<=>
std::weak_ptr wrapper that do not allow you to create strong pointer (std::shared_ptr)
lock_ptr lock() const noexcept
Lock and return strong pointer.
bool expired() const noexcept
If pointer is expired.
void reset() noexcept
Reset weak pointer.
#define QX_NONCOPYMOVABLE(className)
Define class as non copyable and non movable.