[*] 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

@ -9,4 +9,3 @@
#include "ClassHelpers.hpp"
#include "ModuleApi.hpp"
#include "SOO.hpp"

View File

@ -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__)

View File

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