From b430cf7c8333ef71b2d2b62a68962d35577d216d Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Thu, 21 Apr 2022 04:15:31 +0200 Subject: [PATCH] do not use deprecated std::aligned_storage --- include/cubescript/cubescript/callable.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/cubescript/cubescript/callable.hh b/include/cubescript/cubescript/callable.hh index 0cb5f62..82cebaf 100644 --- a/include/cubescript/cubescript/callable.hh +++ b/include/cubescript/cubescript/callable.hh @@ -61,7 +61,7 @@ private: size_t asize; }; - std::aligned_storage_t p_stor; + alignas(std::max_align_t) unsigned char p_stor[sizeof(void *) * 4]; base *p_func; static inline base *as_base(void *p) { @@ -170,7 +170,7 @@ public: } void swap(callable &f) noexcept { - std::aligned_storage_t tmp_stor; + alignas(std::max_align_t) unsigned char tmp_stor[sizeof(p_stor)]; if (small_storage() && f.small_storage()) { auto *t = as_base(&tmp_stor); p_func->move_to(t);