aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/function.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/function.hxx
parent343d6e69e412166cfc21f268a51b692cb0201653 (diff)
Replace deprecated std::aligned_storage with alignas
Based on patch by Matthew Krupcale.
Diffstat (limited to 'libbuild2/function.hxx')
-rw-r--r--libbuild2/function.hxx9
1 files changed, 5 insertions, 4 deletions
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 <utility> // index_sequence
-#include <type_traits> // aligned_storage
+#include <cstddef> // max_align_t
+#include <utility> // index_sequence
+#include <type_traits> // is_*
#include <libbuild2/types.hxx>
#include <libbuild2/forward.hxx>
@@ -133,8 +134,8 @@ namespace build2
// Auxiliary data storage. Note that it is expected to be trivially
// copyable and destructible.
//
- std::aligned_storage<sizeof (void*) * 3>::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,