We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
std::aligned_storage
1 parent b3dbe30 commit 27ef53aCopy full SHA for 27ef53a
include/behaviortree_cpp/contrib/any.hpp
@@ -21,6 +21,7 @@
21
#include <stdexcept>
22
#include <utility>
23
#include <new>
24
+#include <array>
25
26
#if defined(PARTICLE)
27
#if !defined(__cpp_exceptions) && !defined(ANY_IMPL_NO_EXCEPTIONS) && !defined(ANY_IMPL_EXCEPTIONS)
@@ -211,7 +212,7 @@ class any final
211
212
213
union storage_union
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*)> {};
216
217
void* dynamic;
218
stack_storage_t stack; // 2 words for e.g. shared_ptr
0 commit comments