refactor(*): add check and constraint diagnostics for illegal alignment
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
#include "CoreTypes.h"
|
||||
#include "Memory/Memory.h"
|
||||
#include "Memory/Alignment.h"
|
||||
#include "Templates/Utility.h"
|
||||
#include "Templates/TypeHash.h"
|
||||
#include "TypeTraits/TypeTraits.h"
|
||||
@ -161,7 +162,7 @@ NAMESPACE_PRIVATE_END
|
||||
inline constexpr size_t ANY_DEFAULT_INLINE_SIZE = 48;
|
||||
inline constexpr size_t ANY_DEFAULT_INLINE_ALIGNMENT = 16;
|
||||
|
||||
template <size_t InlineSize, size_t InlineAlignment = ANY_DEFAULT_INLINE_ALIGNMENT>
|
||||
template <size_t InlineSize, size_t InlineAlignment = ANY_DEFAULT_INLINE_ALIGNMENT> requires (Memory::IsValidAlignment(InlineAlignment))
|
||||
struct TAny
|
||||
{
|
||||
template <typename T>
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "Templates/Any.h"
|
||||
#include "Templates/Tuple.h"
|
||||
#include "Templates/Invoke.h"
|
||||
#include "Memory/Alignment.h"
|
||||
#include "Templates/Utility.h"
|
||||
#include "Templates/TypeHash.h"
|
||||
#include "Templates/Container.h"
|
||||
@ -39,7 +40,7 @@ enum class EFunctionSpecifiers
|
||||
ConstRValue,
|
||||
};
|
||||
|
||||
template <typename F, size_t InlineSize, size_t InlineAlignment, EFunctionSpecifiers Specifiers, EFunctionType FunctionType>
|
||||
template <typename F, size_t InlineSize, size_t InlineAlignment, EFunctionSpecifiers Specifiers, EFunctionType FunctionType> requires (Memory::IsValidAlignment(InlineAlignment))
|
||||
struct TFunctionImpl;
|
||||
|
||||
template <typename T> struct TIsTFunctionImpl : FFalse { };
|
||||
@ -370,7 +371,7 @@ inline constexpr size_t FUNCTION_DEFAULT_INLINE_SIZE = 32;
|
||||
inline constexpr size_t FUNCTION_DEFAULT_INLINE_ALIGNMENT = 16;
|
||||
|
||||
template <typename F>
|
||||
using TFunctionRef = typename NAMESPACE_PRIVATE::TFunctionSelect<F, INDEX_NONE, INDEX_NONE, NAMESPACE_PRIVATE::EFunctionType::Reference>::Type;
|
||||
using TFunctionRef = typename NAMESPACE_PRIVATE::TFunctionSelect<F, 0, 0, NAMESPACE_PRIVATE::EFunctionType::Reference>::Type;
|
||||
|
||||
template <typename F, size_t InlineSize = FUNCTION_DEFAULT_INLINE_SIZE, size_t InlineAlignment = FUNCTION_DEFAULT_INLINE_ALIGNMENT>
|
||||
using TFunction = typename NAMESPACE_PRIVATE::TFunctionSelect<F, InlineSize, InlineAlignment, NAMESPACE_PRIVATE::EFunctionType::Object>::Type;
|
||||
|
Reference in New Issue
Block a user