17 inline constexpr
hkRefPtr(std::nullptr_t) noexcept :
25 std::is_convertible_v<
46 std::is_convertible_v<
58 _ptr(std::move(a_rhs._ptr))
67 std::is_convertible_v<
72 _ptr(std::move(a_rhs._ptr))
85 if (
this != std::addressof(a_rhs)) {
97 std::is_convertible_v<
112 if (
this != std::addressof(a_rhs)) {
114 _ptr = std::move(a_rhs._ptr);
115 a_rhs._ptr =
nullptr;
124 std::is_convertible_v<
131 _ptr = std::move(a_rhs._ptr);
132 a_rhs._ptr =
nullptr;
144 std::is_convertible_v<
162 [[nodiscard]]
explicit constexpr
operator bool() const noexcept
164 return static_cast<bool>(
_ptr);
169 assert(
static_cast<bool>(*
this));
175 assert(
static_cast<bool>(*
this));
186 _ptr->AddReference();
193 _ptr->RemoveReference();
203 template <
class T,
class... Args>
206 return hkRefPtr<T>{
new T(std::forward<Args>(a_args)...) };
209 template <
class T1,
class T2>
212 return a_lhs.
get() == a_rhs.
get();
215 template <
class T1,
class T2>
218 return !(a_lhs == a_rhs);
236 return static_cast<bool>(a_lhs);
242 return static_cast<bool>(a_rhs);
hkRefPtr(const hkRefPtr< Y > &a_rhs)
Definition: hkRefPtr.h:50
hkRefPtr(const hkRefPtr &a_rhs)
Definition: hkRefPtr.h:36
hkRefPtr & operator=(const hkRefPtr &a_rhs)
Definition: hkRefPtr.h:83
constexpr element_type * get() const noexcept
Definition: hkRefPtr.h:157
constexpr element_type * operator->() const noexcept
Definition: hkRefPtr.h:173
hkRefPtr & operator=(const hkRefPtr< Y > &a_rhs)
Definition: hkRefPtr.h:101
T element_type
Definition: hkRefPtr.h:9
constexpr element_type & operator*() const noexcept
Definition: hkRefPtr.h:167
void reset(Y *a_ptr)
Definition: hkRefPtr.h:148
void TryAttach()
Definition: hkRefPtr.h:183
void TryDetach()
Definition: hkRefPtr.h:190
hkRefPtr(Y *a_rhs)
Definition: hkRefPtr.h:29
hkRefPtr(hkRefPtr &&a_rhs) noexcept
Definition: hkRefPtr.h:57
hkRefPtr & operator=(hkRefPtr< Y > &&a_rhs)
Definition: hkRefPtr.h:128
~hkRefPtr()
Definition: hkRefPtr.h:77
constexpr hkRefPtr() noexcept
Definition: hkRefPtr.h:12
constexpr hkRefPtr(std::nullptr_t) noexcept
Definition: hkRefPtr.h:17
void reset()
Definition: hkRefPtr.h:136
hkRefPtr & operator=(hkRefPtr &&a_rhs)
Definition: hkRefPtr.h:110
element_type * _ptr
Definition: hkRefPtr.h:199
hkRefPtr(hkRefPtr< Y > &&a_rhs) noexcept
Definition: hkRefPtr.h:71
Definition: AbsorbEffect.h:6
constexpr bool operator==(const BSTSmartPointer< T1 > &a_lhs, const BSTSmartPointer< T2 > &a_rhs)
Definition: BSTSmartPointer.h:241
hkRefPtr(T *) -> hkRefPtr< T >
constexpr bool operator!=(const BSTSmartPointer< T1 > &a_lhs, const BSTSmartPointer< T2 > &a_rhs)
Definition: BSTSmartPointer.h:247
hkRefPtr< T > make_hkref(Args &&... a_args)
Definition: hkRefPtr.h:204