[+] SOO to shared ptr

This commit is contained in:
Reece Wilson 2023-12-23 04:10:02 +00:00
parent 9c8f07cb5d
commit fa951eac4b

View File

@ -76,6 +76,17 @@ struct AU_ALIGN(sizeof(AuUInt)) Type ## SOO
return (extends *)this->padding; \
} \
} \
inline auto AsUnsafeSharedPointer() \
{ \
if constexpr (std::is_const_v<AuRemovePointer_t<decltype(this)>>) \
{ \
return AuUnsafeRaiiToShared((const extends *)this->padding); \
} \
else \
{ \
return AuUnsafeRaiiToShared((extends *)this->padding); \
} \
} \
inline operator extends&() \
{ \
return *(extends *)this->padding; \
@ -84,6 +95,10 @@ struct AU_ALIGN(sizeof(AuUInt)) Type ## SOO
{ \
return (extends *)this->padding; \
} \
inline operator AuSPtr<extends>() \
{ \
return AuUnsafeRaiiToShared((extends *)this->padding); \
} \
inline operator const extends&() const \
{ \
return *(const extends *)this->padding; \