Workaround compilers w/o C++1z inline variables
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287255 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -796,6 +796,11 @@ template <unsigned> struct __static_assert_check {};
|
|||||||
#define _LIBCPP_CONSTEXPR_AFTER_CXX14
|
#define _LIBCPP_CONSTEXPR_AFTER_CXX14
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// FIXME: Remove all usages of this macro once compilers catch up.
|
||||||
|
#if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606L)
|
||||||
|
# define _LIBCPP_HAS_NO_INLINE_VARIABLES
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
# define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x)
|
# define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x)
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -897,21 +897,30 @@ _T1 exchange(_T1& __obj, _T2 && __new_value)
|
|||||||
struct _LIBCPP_TYPE_VIS in_place_t {
|
struct _LIBCPP_TYPE_VIS in_place_t {
|
||||||
explicit in_place_t() = default;
|
explicit in_place_t() = default;
|
||||||
};
|
};
|
||||||
inline constexpr in_place_t in_place{};
|
#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES
|
||||||
|
inline
|
||||||
|
#endif
|
||||||
|
constexpr in_place_t in_place{};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_TYPE_VIS in_place_type_t {
|
struct _LIBCPP_TYPE_VIS in_place_type_t {
|
||||||
explicit in_place_type_t() = default;
|
explicit in_place_type_t() = default;
|
||||||
};
|
};
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
inline constexpr in_place_type_t<_Tp> in_place_type{};
|
#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES
|
||||||
|
inline
|
||||||
|
#endif
|
||||||
|
constexpr in_place_type_t<_Tp> in_place_type{};
|
||||||
|
|
||||||
template <size_t _Idx>
|
template <size_t _Idx>
|
||||||
struct _LIBCPP_TYPE_VIS in_place_index_t {
|
struct _LIBCPP_TYPE_VIS in_place_index_t {
|
||||||
explicit in_place_index_t() = default;
|
explicit in_place_index_t() = default;
|
||||||
};
|
};
|
||||||
template <size_t _Idx>
|
template <size_t _Idx>
|
||||||
inline constexpr in_place_index_t<_Idx> in_place_index{};
|
#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES
|
||||||
|
inline
|
||||||
|
#endif
|
||||||
|
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 : false_type {};
|
||||||
template <class _Tp> struct __is_inplace_type_imp<in_place_type_t<_Tp>> : true_type {};
|
template <class _Tp> struct __is_inplace_type_imp<in_place_type_t<_Tp>> : true_type {};
|
||||||
|
|||||||
Reference in New Issue
Block a user