13 std::unique_ptr<Bedrock::EnableNonOwnerReferences> mEnableNonOwnerReferences;
14 std::unique_ptr<T> mValue;
28 : mEnableNonOwnerReferences(std::make_unique<Bedrock::EnableNonOwnerReferences>(*ptr)),
29 mValue(std::move(ptr)) {}
33 T* get()
const {
return mValue.get(); }
34 T* operator->()
const {
return get(); }
35 T& operator*()
const {
return *get(); }
37 bool isValid()
const {
return mValue !=
nullptr; }
38 explicit operator bool()
const {
return isValid(); }
41 mEnableNonOwnerReferences.reset();
45 bool operator==(
UniqueOwnerPointer const& other)
const {
return mValue == other.mValue; }
46 bool operator==(nullptr_t)
const {
return mValue ==
nullptr; }