[*] 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"
|
@ -42,10 +42,30 @@
|
||||
struct Type ## SOO \
|
||||
{ \
|
||||
AUROXTL_INTERFACE_SOO_HDR_(vis, Type ## SOO, targetSize, ## __VA_ARGS__) \
|
||||
inline extends *operator ->() \
|
||||
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; \
|
||||
@ -54,15 +74,6 @@ struct Type ## SOO \
|
||||
{ \
|
||||
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; \
|
||||
@ -71,14 +82,10 @@ struct Type ## SOO \
|
||||
{ \
|
||||
return (const extends *)this->padding; \
|
||||
} \
|
||||
inline const extends * AsPointer() 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