aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/variable.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-03-02 15:38:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-03-02 15:38:15 +0200
commit417be15231cb34a2e858d26b63406d1fb5535cb9 (patch)
tree12c8feacfac7b108405d26cf88ba19284df346c6 /libbuild2/variable.hxx
parent343d6e69e412166cfc21f268a51b692cb0201653 (diff)
Replace deprecated std::aligned_storage with alignas
Based on patch by Matthew Krupcale.
Diffstat (limited to 'libbuild2/variable.hxx')
-rw-r--r--libbuild2/variable.hxx7
1 files changed, 4 insertions, 3 deletions
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 <type_traits> // aligned_storage
+#include <cstddef> // max_align_t
+#include <type_traits> // is_*
#include <unordered_map>
#include <libbutl/prefix-map.hxx>
@@ -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<size_>::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.
//