aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/target.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/target.hxx
parent343d6e69e412166cfc21f268a51b692cb0201653 (diff)
Replace deprecated std::aligned_storage with alignas
Based on patch by Matthew Krupcale.
Diffstat (limited to 'libbuild2/target.hxx')
-rw-r--r--libbuild2/target.hxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/libbuild2/target.hxx b/libbuild2/target.hxx
index 26c7208..037b18c 100644
--- a/libbuild2/target.hxx
+++ b/libbuild2/target.hxx
@@ -4,8 +4,9 @@
#ifndef LIBBUILD2_TARGET_HXX
#define LIBBUILD2_TARGET_HXX
+#include <cstddef> // max_align_t
#include <iterator> // tags, etc.
-#include <type_traits> // aligned_storage
+#include <type_traits> // is_*
#include <unordered_map>
#include <libbutl/multi-index.hxx> // map_iterator_adapter
@@ -189,7 +190,7 @@ namespace build2
? sizeof (string)
: sizeof (void*) * 4);
- std::aligned_storage<data_size>::type data_;
+ alignas (std::max_align_t) unsigned char data_[data_size];
void (*data_dtor_) (void*) = nullptr;
template <typename R,
@@ -1624,8 +1625,7 @@ namespace build2
group_view g_;
size_t j_; // 1-based index, to support enter_group().
const target* k_; // Current member of ad hoc group or NULL.
- mutable typename std::aligned_storage<sizeof (value_type),
- alignof (value_type)>::type m_;
+ alignas (value_type) mutable unsigned char m_[sizeof (value_type)];
};
iterator