[*] Updated SOO for SFINAE
This commit is contained in:
parent
387e9c231e
commit
ce59f4c437
@ -9,4 +9,3 @@
|
||||
|
||||
#include "ClassHelpers.hpp"
|
||||
#include "ModuleApi.hpp"
|
||||
#include "SOO.hpp"
|
@ -38,47 +38,54 @@
|
||||
vis type(AU_FOR_EACH_FIRST(_AUROXTL_INTERRFACE_SOO_EMITTER_0, _AUROXTL_INTERRFACE_SOO_EMITTER_1, ## __VA_ARGS__, (AuUInt32, uSOOSize = kSSOPaddedSize)));\
|
||||
vis ~type();
|
||||
|
||||
#define AUROXTL_INTERFACE_SOO_HDR_EX(vis, Type, extends, targetSize, ...)\
|
||||
struct Type ## SOO \
|
||||
{ \
|
||||
AUROXTL_INTERFACE_SOO_HDR_(vis, Type ## SOO, targetSize, ## __VA_ARGS__) \
|
||||
inline extends *operator ->() \
|
||||
{ \
|
||||
return (extends *)this->padding; \
|
||||
} \
|
||||
inline operator extends&() \
|
||||
{ \
|
||||
return *(extends *)this->padding; \
|
||||
} \
|
||||
inline operator extends*() \
|
||||
{ \
|
||||
return (extends *)this->padding; \
|
||||
} \
|
||||
inline extends * AsPointer() \
|
||||
{ \
|
||||
return (extends *)this->padding; \
|
||||
} \
|
||||
\
|
||||
inline const extends *operator ->() const \
|
||||
{ \
|
||||
return (const extends *)this->padding; \
|
||||
} \
|
||||
inline operator const extends&() const \
|
||||
{ \
|
||||
return *(const extends *)this->padding; \
|
||||
} \
|
||||
inline operator const extends*() const \
|
||||
{ \
|
||||
return (const extends *)this->padding; \
|
||||
} \
|
||||
inline const extends * AsPointer() const \
|
||||
{ \
|
||||
return (const extends *)this->padding; \
|
||||
} \
|
||||
}; \
|
||||
#define AUROXTL_INTERFACE_SOO_HDR_EX(vis, Type, extends, targetSize, ...) \
|
||||
struct Type ## SOO \
|
||||
{ \
|
||||
AUROXTL_INTERFACE_SOO_HDR_(vis, Type ## SOO, targetSize, ## __VA_ARGS__) \
|
||||
inline auto operator ->() \
|
||||
{ \
|
||||
if constexpr (std::is_const_v<typename AuRemovePointer_t<decltype(this)>>) \
|
||||
{ \
|
||||
return (const extends *)this->padding; \
|
||||
\
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
return ( extends *)this->padding; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
inline auto AsPointer() \
|
||||
{ \
|
||||
if constexpr (std::is_const_v<typename AuRemovePointer_t<decltype(this)>>) \
|
||||
{ \
|
||||
return (const extends *)this->padding; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
return (extends *)this->padding; \
|
||||
} \
|
||||
} \
|
||||
inline operator extends&() \
|
||||
{ \
|
||||
return *(extends *)this->padding; \
|
||||
} \
|
||||
inline operator extends*() \
|
||||
{ \
|
||||
return (extends *)this->padding; \
|
||||
} \
|
||||
inline operator const extends&() const \
|
||||
{ \
|
||||
return *(const extends *)this->padding; \
|
||||
} \
|
||||
inline operator const extends*() const \
|
||||
{ \
|
||||
return (const extends *)this->padding; \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
using Type ## SOO_t = Type ## SOO;
|
||||
|
||||
|
||||
#define AUROXTL_INTERFACE_SOO_HDR(Type, extends, targetSize, ...) \
|
||||
AUROXTL_INTERFACE_SOO_HDR_EX(, Type, extends, targetSize, ## __VA_ARGS__)
|
||||
|
||||
|
@ -55,6 +55,8 @@
|
||||
|
||||
#include <auROXTL/auBuildTime.hpp>
|
||||
|
||||
#include <auROXTL/Objects/SOO.hpp>
|
||||
|
||||
struct IAuNullDelegate
|
||||
{
|
||||
virtual void OnCall() = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user