From 417be15231cb34a2e858d26b63406d1fb5535cb9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 2 Mar 2023 15:38:15 +0200 Subject: Replace deprecated std::aligned_storage with alignas Based on patch by Matthew Krupcale. --- libbuild2/function.hxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'libbuild2/function.hxx') diff --git a/libbuild2/function.hxx b/libbuild2/function.hxx index 323ac41..cda856a 100644 --- a/libbuild2/function.hxx +++ b/libbuild2/function.hxx @@ -4,8 +4,9 @@ #ifndef LIBBUILD2_FUNCTION_HXX #define LIBBUILD2_FUNCTION_HXX -#include // index_sequence -#include // aligned_storage +#include // max_align_t +#include // index_sequence +#include // is_* #include #include @@ -133,8 +134,8 @@ namespace build2 // Auxiliary data storage. Note that it is expected to be trivially // copyable and destructible. // - std::aligned_storage::type data; - static const size_t data_size = sizeof (decltype (data)); + static const size_t data_size = sizeof (void*) * 3; + alignas (std::max_align_t) unsigned char data[data_size]; function_overload (const char* an, size_t mi, size_t ma, types ts, -- cgit v1.1