Skip to content

Commit 27ef53a

Browse files
committed
Remove use of std::aligned_storage
The type has been deprecated in C++23, which may cause warnings in client code using this header.
1 parent b3dbe30 commit 27ef53a

File tree

1 file changed

+2
-1
lines changed
  • include/behaviortree_cpp/contrib

1 file changed

+2
-1
lines changed

include/behaviortree_cpp/contrib/any.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <stdexcept>
2222
#include <utility>
2323
#include <new>
24+
#include <array>
2425

2526
#if defined(PARTICLE)
2627
#if !defined(__cpp_exceptions) && !defined(ANY_IMPL_NO_EXCEPTIONS) && !defined(ANY_IMPL_EXCEPTIONS)
@@ -211,7 +212,7 @@ class any final
211212

212213
union storage_union
213214
{
214-
using stack_storage_t = typename std::aligned_storage<2 * sizeof(void*), std::alignment_of<void*>::value>::type;
215+
struct alignas(void*) stack_storage_t : std::array<std::byte, 2 * sizeof(void*)> {};
215216

216217
void* dynamic;
217218
stack_storage_t stack; // 2 words for e.g. shared_ptr

0 commit comments

Comments
 (0)