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);