12 inline constexpr
GPtr() noexcept :
17 inline constexpr
GPtr(std::nullptr_t) noexcept :
25 std::is_convertible_v<
29 inline explicit GPtr(Y* a_rhs) :
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));
203 template <
class T,
class... Args>
206 auto ptr =
GPtr<T>{
new T(std::forward<Args>(a_args)...) };
213 template <
class T1,
class T2>
216 return a_lhs.
get() == a_rhs.
get();
219 template <
class T1,
class T2>
222 return !(a_lhs == a_rhs);
240 return static_cast<bool>(a_lhs);
246 return static_cast<bool>(a_rhs);
void reset(Y *a_ptr)
Definition: GPtr.h:148
T element_type
Definition: GPtr.h:9
GPtr(GPtr &&a_rhs) noexcept
Definition: GPtr.h:57
~GPtr()
Definition: GPtr.h:77
constexpr element_type * operator->() const noexcept
Definition: GPtr.h:173
element_type * _ptr
Definition: GPtr.h:199
void reset()
Definition: GPtr.h:136
void TryDetach()
Definition: GPtr.h:190
void TryAttach()
Definition: GPtr.h:183
GPtr & operator=(const GPtr< Y > &a_rhs)
Definition: GPtr.h:101
GPtr(GPtr< Y > &&a_rhs) noexcept
Definition: GPtr.h:71
GPtr & operator=(const GPtr &a_rhs)
Definition: GPtr.h:83
constexpr GPtr() noexcept
Definition: GPtr.h:12
GPtr(Y *a_rhs)
Definition: GPtr.h:29
GPtr(const GPtr &a_rhs)
Definition: GPtr.h:36
constexpr element_type * get() const noexcept
Definition: GPtr.h:157
constexpr element_type & operator*() const noexcept
Definition: GPtr.h:167
GPtr(const GPtr< Y > &a_rhs)
Definition: GPtr.h:50
constexpr GPtr(std::nullptr_t) noexcept
Definition: GPtr.h:17
GPtr & operator=(GPtr< Y > &&a_rhs)
Definition: GPtr.h:128
GPtr & operator=(GPtr &&a_rhs)
Definition: GPtr.h:110
Definition: AbsorbEffect.h:6
GPtr< T > make_gptr(Args &&... a_args)
Definition: GPtr.h:204
constexpr bool operator==(const BSTSmartPointer< T1 > &a_lhs, const BSTSmartPointer< T2 > &a_rhs)
Definition: BSTSmartPointer.h:241
constexpr bool operator!=(const BSTSmartPointer< T1 > &a_lhs, const BSTSmartPointer< T2 > &a_rhs)
Definition: BSTSmartPointer.h:247