From 27ef53a58e99c92fbcea56a9fa99f9a4895e0d03 Mon Sep 17 00:00:00 2001 From: Vincent PALANCHER Date: Wed, 21 Jan 2026 11:04:30 +0100 Subject: [PATCH] Remove use of `std::aligned_storage` The type has been deprecated in C++23, which may cause warnings in client code using this header. --- include/behaviortree_cpp/contrib/any.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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