43 noexcept : _shared_ptr(), _weak_ptr(other._weak_ptr) {}
46 requires(std::is_convertible_v<std::remove_cvref_t<Y> *, value_type *>)
weak_or_unique_ptr &
50 _weak_ptr = other._weak_ptr;
56 noexcept : _shared_ptr(other._shared_ptr), _weak_ptr(other._weak_ptr) {}
59 requires(std::is_convertible_v<std::remove_cvref_t<Y> *, value_type *>)
weak_or_unique_ptr &
62 _shared_ptr = other._shared_ptr;
63 _weak_ptr = other._weak_ptr;
69 noexcept : _shared_ptr(
std::move(other)), _weak_ptr(_shared_ptr) {}
72 requires(std::is_convertible_v<std::remove_cvref_t<Y> *, value_type *>)
weak_or_unique_ptr &
76 _weak_ptr = _shared_ptr;
82 noexcept : _shared_ptr(), _weak_ptr(other) {}
85 requires(std::is_convertible_v<std::remove_cvref_t<Y> *, value_type *>)
weak_or_unique_ptr &
88 _shared_ptr =
nullptr;
95 noexcept : _shared_ptr(), _weak_ptr(other) {}
99 noexcept : _shared_ptr(), _weak_ptr(
std::move(other)) {}
102 requires(std::is_convertible_v<std::remove_cvref_t<Y> *, value_type *>)
weak_or_unique_ptr &
105 _shared_ptr =
nullptr;
111 requires(std::is_convertible_v<std::remove_cvref_t<Y> *, value_type *>)
weak_or_unique_ptr &
114 _shared_ptr =
nullptr;
119 void reset()
noexcept
121 _shared_ptr =
nullptr;
125 [[nodiscard]]
bool expired()
const noexcept
127 return _weak_ptr.expired();
132 return _weak_ptr.lock();