diff options
Diffstat (limited to 'libbuild2/function.hxx')
-rw-r--r-- | libbuild2/function.hxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libbuild2/function.hxx b/libbuild2/function.hxx index 8fdf8f4..cda856a 100644 --- a/libbuild2/function.hxx +++ b/libbuild2/function.hxx @@ -4,9 +4,9 @@ #ifndef LIBBUILD2_FUNCTION_HXX #define LIBBUILD2_FUNCTION_HXX -#include <map> -#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> @@ -134,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, @@ -196,7 +196,7 @@ namespace build2 class LIBBUILD2_SYMEXPORT function_map { public: - using map_type = std::map<string, function_overloads>; + using map_type = map<string, function_overloads>; using iterator = map_type::iterator; using const_iterator = map_type::const_iterator; @@ -951,9 +951,10 @@ namespace build2 typename cast::data {&cast::thunk, dm})); } - // Low-level interface that can be used to register additional data. + // Low-level interface that can be used to pass additional data. // - // Note that the call to this function sidesteps the thunk. + // Note that the call to this function sidesteps the thunk. One notable + // consequence of this is that the values are not checked for NULL. // template <typename D, typename... A> void |