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/variable.hxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libbuild2/variable.hxx') diff --git a/libbuild2/variable.hxx b/libbuild2/variable.hxx index 8a0adf8..b137789 100644 --- a/libbuild2/variable.hxx +++ b/libbuild2/variable.hxx @@ -4,7 +4,8 @@ #ifndef LIBBUILD2_VARIABLE_HXX #define LIBBUILD2_VARIABLE_HXX -#include // aligned_storage +#include // max_align_t +#include // is_* #include #include @@ -423,8 +424,8 @@ namespace build2 // specialization below). Types that don't fit will have to be handled // with an extra dynamic allocation. // - static constexpr size_t size_ = sizeof (name_pair); - std::aligned_storage::type data_; + static constexpr size_t size_ = sizeof (name_pair); + alignas (std::max_align_t) unsigned char data_[size_]; // Make sure we have sufficient storage for untyped values. // -- cgit v1.1