[+] SOO to shared ptr
This commit is contained in:
parent
9c8f07cb5d
commit
fa951eac4b
@ -76,6 +76,17 @@ struct AU_ALIGN(sizeof(AuUInt)) Type ## SOO
|
|||||||
return (extends *)this->padding; \
|
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&() \
|
inline operator extends&() \
|
||||||
{ \
|
{ \
|
||||||
return *(extends *)this->padding; \
|
return *(extends *)this->padding; \
|
||||||
@ -84,6 +95,10 @@ struct AU_ALIGN(sizeof(AuUInt)) Type ## SOO
|
|||||||
{ \
|
{ \
|
||||||
return (extends *)this->padding; \
|
return (extends *)this->padding; \
|
||||||
} \
|
} \
|
||||||
|
inline operator AuSPtr<extends>() \
|
||||||
|
{ \
|
||||||
|
return AuUnsafeRaiiToShared((extends *)this->padding); \
|
||||||
|
} \
|
||||||
inline operator const extends&() const \
|
inline operator const extends&() const \
|
||||||
{ \
|
{ \
|
||||||
return *(const extends *)this->padding; \
|
return *(const extends *)this->padding; \
|
||||||
|
Loading…
Reference in New Issue
Block a user