diff --git a/include/behaviortree_cpp/contrib/any.hpp b/include/behaviortree_cpp/contrib/any.hpp index acc1321a2..910aadd90 100644 --- a/include/behaviortree_cpp/contrib/any.hpp +++ b/include/behaviortree_cpp/contrib/any.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #if defined(PARTICLE) #if !defined(__cpp_exceptions) && !defined(ANY_IMPL_NO_EXCEPTIONS) && !defined(ANY_IMPL_EXCEPTIONS) @@ -211,7 +212,7 @@ class any final union storage_union { - using stack_storage_t = typename std::aligned_storage<2 * sizeof(void*), std::alignment_of::value>::type; + struct alignas(void*) stack_storage_t : std::array {}; void* dynamic; stack_storage_t stack; // 2 words for e.g. shared_ptr