[*] Updated SOO for SFINAE

This commit is contained in:
Reece Wilson 2023-03-22 23:07:03 +00:00
parent 387e9c231e
commit ce59f4c437
3 changed files with 49 additions and 41 deletions

View File

@ -8,5 +8,4 @@
#pragma once #pragma once
#include "ClassHelpers.hpp" #include "ClassHelpers.hpp"
#include "ModuleApi.hpp" #include "ModuleApi.hpp"
#include "SOO.hpp"

View File

@ -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(AU_FOR_EACH_FIRST(_AUROXTL_INTERRFACE_SOO_EMITTER_0, _AUROXTL_INTERRFACE_SOO_EMITTER_1, ## __VA_ARGS__, (AuUInt32, uSOOSize = kSSOPaddedSize)));\
vis ~type(); vis ~type();
#define AUROXTL_INTERFACE_SOO_HDR_EX(vis, Type, extends, targetSize, ...)\ #define AUROXTL_INTERFACE_SOO_HDR_EX(vis, Type, extends, targetSize, ...) \
struct Type ## SOO \ struct Type ## SOO \
{ \ { \
AUROXTL_INTERFACE_SOO_HDR_(vis, Type ## SOO, targetSize, ## __VA_ARGS__) \ AUROXTL_INTERFACE_SOO_HDR_(vis, Type ## SOO, targetSize, ## __VA_ARGS__) \
inline extends *operator ->() \ inline auto operator ->() \
{ \ { \
return (extends *)this->padding; \ if constexpr (std::is_const_v<typename AuRemovePointer_t<decltype(this)>>) \
} \ { \
inline operator extends&() \ return (const extends *)this->padding; \
{ \ \
return *(extends *)this->padding; \ } \
} \ else \
inline operator extends*() \ { \
{ \ return ( extends *)this->padding; \
return (extends *)this->padding; \ } \
} \ } \
inline extends * AsPointer() \ \
{ \ inline auto AsPointer() \
return (extends *)this->padding; \ { \
} \ if constexpr (std::is_const_v<typename AuRemovePointer_t<decltype(this)>>) \
\ { \
inline const extends *operator ->() const \ return (const extends *)this->padding; \
{ \ } \
return (const extends *)this->padding; \ else \
} \ { \
inline operator const extends&() const \ return (extends *)this->padding; \
{ \ } \
return *(const extends *)this->padding; \ } \
} \ inline operator extends&() \
inline operator const extends*() const \ { \
{ \ return *(extends *)this->padding; \
return (const extends *)this->padding; \ } \
} \ inline operator extends*() \
inline const extends * AsPointer() const \ { \
{ \ return (extends *)this->padding; \
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; \
} \
}; \
\
using Type ## SOO_t = Type ## SOO; using Type ## SOO_t = Type ## SOO;
#define AUROXTL_INTERFACE_SOO_HDR(Type, extends, targetSize, ...) \ #define AUROXTL_INTERFACE_SOO_HDR(Type, extends, targetSize, ...) \
AUROXTL_INTERFACE_SOO_HDR_EX(, Type, extends, targetSize, ## __VA_ARGS__) AUROXTL_INTERFACE_SOO_HDR_EX(, Type, extends, targetSize, ## __VA_ARGS__)

View File

@ -55,6 +55,8 @@
#include <auROXTL/auBuildTime.hpp> #include <auROXTL/auBuildTime.hpp>
#include <auROXTL/Objects/SOO.hpp>
struct IAuNullDelegate struct IAuNullDelegate
{ {
virtual void OnCall() = 0; virtual void OnCall() = 0;