From cece4be1ec771e710c0845b10a80db373f37d031 Mon Sep 17 00:00:00 2001 From: skypjack Date: Wed, 8 Oct 2025 14:20:48 +0200 Subject: [PATCH] any: prepare for ebco --- src/entt/core/any.hpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/entt/core/any.hpp b/src/entt/core/any.hpp index 200da0dad..4f5e2629e 100644 --- a/src/entt/core/any.hpp +++ b/src/entt/core/any.hpp @@ -26,6 +26,15 @@ enum class any_request : std::uint8_t { get }; +template +struct storage_type { + // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) + alignas(Align) std::byte data[Len]; +}; + +template +struct storage_type<0u, Align> {}; + } // namespace internal /*! @endcond */ @@ -38,11 +47,7 @@ template class basic_any { using request = internal::any_request; using vtable_type = const void *(const request, const basic_any &, const void *); - - struct storage_type { - // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) - alignas(Align) std::byte data[Len + static_cast(Len == 0u)]; - }; + using storage_type = internal::storage_type; template // NOLINTNEXTLINE(bugprone-sizeof-expression)