summaryrefslogtreecommitdiff
path: root/include/utility
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:07:56 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:07:56 +0000
commitf36202620b428c45a1c8d91743727c9313424fb2 (patch)
tree14928d8970ba4890a6370aca4c38fc832d45f21f /include/utility
parent0294ba5648d889e48ffee8ddad25944e258940ae (diff)
Notes
Diffstat (limited to 'include/utility')
-rw-r--r--include/utility25
1 files changed, 9 insertions, 16 deletions
diff --git a/include/utility b/include/utility
index 288c6e823c3b7..8fdaf65db6a66 100644
--- a/include/utility
+++ b/include/utility
@@ -14,6 +14,8 @@
/*
utility synopsis
+#include <initializer_list>
+
namespace std
{
@@ -52,7 +54,7 @@ template <class T>
>::type
move_if_noexcept(T& x) noexcept; // constexpr in C++14
-template <class T> constexpr add_const<T>_t& as_const(T& t) noexcept; // C++17
+template <class T> constexpr add_const_t<T>& as_const(T& t) noexcept; // C++17
template <class T> void as_const(const T&&) = delete; // C++17
template <class T> typename add_rvalue_reference<T>::type declval() noexcept;
@@ -99,7 +101,7 @@ void
swap(pair<T1, T2>& x, pair<T1, T2>& y) noexcept(noexcept(x.swap(y)));
struct piecewise_construct_t { };
-constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
+inline constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
template <class T> class tuple_size;
template <size_t I, class T> class tuple_element;
@@ -296,7 +298,7 @@ struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { };
#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_UTILITY)
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
#else
-constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
+/* _LIBCPP_INLINE_VAR */ constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
#endif
#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
@@ -890,7 +892,7 @@ template<class... _Tp>
#if _LIBCPP_STD_VER > 11
template<class _T1, class _T2 = _T1>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_T1 exchange(_T1& __obj, _T2 && __new_value)
{
_T1 __old_value = _VSTD::move(__obj);
@@ -904,30 +906,21 @@ _T1 exchange(_T1& __obj, _T2 && __new_value)
struct _LIBCPP_TYPE_VIS in_place_t {
explicit in_place_t() = default;
};
-#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES
-inline
-#endif
-constexpr in_place_t in_place{};
+_LIBCPP_INLINE_VAR constexpr in_place_t in_place{};
template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS in_place_type_t {
explicit in_place_type_t() = default;
};
template <class _Tp>
-#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES
-inline
-#endif
-constexpr in_place_type_t<_Tp> in_place_type{};
+_LIBCPP_INLINE_VAR constexpr in_place_type_t<_Tp> in_place_type{};
template <size_t _Idx>
struct _LIBCPP_TYPE_VIS in_place_index_t {
explicit in_place_index_t() = default;
};
template <size_t _Idx>
-#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES
-inline
-#endif
-constexpr in_place_index_t<_Idx> in_place_index{};
+_LIBCPP_INLINE_VAR constexpr in_place_index_t<_Idx> in_place_index{};
template <class _Tp> struct __is_inplace_type_imp : false_type {};
template <class _Tp> struct __is_inplace_type_imp<in_place_type_t<_Tp>> : true_type {};