From 71d9a71b208b53a5d55d41bc2980338bc04b818c Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 6 Aug 2024 14:46:18 +1000 Subject: [PATCH] par/stack: use our own aligned_storage_t alternative aligned_storage_t is deprecated and will generate warnings. Use a very similar construct within the stack itself instead. --- cruft/util/parallel/stack.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cruft/util/parallel/stack.hpp b/cruft/util/parallel/stack.hpp index 591491f9..03cbb188 100644 --- a/cruft/util/parallel/stack.hpp +++ b/cruft/util/parallel/stack.hpp @@ -154,7 +154,10 @@ namespace cruft::parallel { private: using index_type = std::size_t; - using raw_type = std::aligned_storage_t; + + struct raw_type { + alignas(ValueT) std::byte data[sizeof(ValueT)]; + }; mutable cruft::thread::spinlock m_lock; std::atomic m_cursor;