diff --git a/modules/juce_core/containers/juce_FixedSizeFunction.h b/modules/juce_core/containers/juce_FixedSizeFunction.h index 1eedf720df..2d185ee9e5 100644 --- a/modules/juce_core/containers/juce_FixedSizeFunction.h +++ b/modules/juce_core/containers/juce_FixedSizeFunction.h @@ -108,14 +108,12 @@ template class FixedSizeFunction { private: - using Storage = std::aligned_storage_t; - template using Decay = std::decay_t; template > using IntIfValidConversion = std::enable_if_t, int>; @@ -137,7 +135,7 @@ public: { static_assert (sizeof (Fn) <= len, "The requested function cannot fit in this FixedSizeFunction"); - static_assert (alignof (Fn) <= alignof (Storage), + static_assert (alignof (Fn) <= alignof (std::max_align_t), "FixedSizeFunction cannot accommodate the requested alignment requirements"); static constexpr auto vtableForCallable = detail::makeVtable(); @@ -228,7 +226,10 @@ private: } const detail::Vtable* vtable = nullptr; - mutable Storage storage; + + JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4324) + alignas (std::max_align_t) mutable std::byte storage[len]; + JUCE_END_IGNORE_WARNINGS_MSVC }; template