Implement most of P0607: Inline Variables for the Standard Library. This involved marking a lot of variables as inline (but only for C++17 and later).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@321658 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2018-01-02 17:17:01 +00:00
parent 05e705f9ec
commit c58e4723e7
15 changed files with 295 additions and 217 deletions

View File

@@ -213,9 +213,9 @@ template<class T> struct is_bind_expression;
template<class T> struct is_placeholder;
// See C++14 20.9.9, Function object binders
template <class T> constexpr bool is_bind_expression_v
template <class T> inline constexpr bool is_bind_expression_v
= is_bind_expression<T>::value; // C++17
template <class T> constexpr int is_placeholder_v
template <class T> inline constexpr int is_placeholder_v
= is_placeholder<T>::value; // C++17
@@ -1991,7 +1991,7 @@ template<class _Tp> struct _LIBCPP_TEMPLATE_VIS is_bind_expression
#if _LIBCPP_STD_VER > 14
template <class _Tp>
constexpr size_t is_bind_expression_v = is_bind_expression<_Tp>::value;
_LIBCPP_INLINE_VAR constexpr size_t is_bind_expression_v = is_bind_expression<_Tp>::value;
#endif
template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
@@ -2000,7 +2000,7 @@ template<class _Tp> struct _LIBCPP_TEMPLATE_VIS is_placeholder
#if _LIBCPP_STD_VER > 14
template <class _Tp>
constexpr size_t is_placeholder_v = is_placeholder<_Tp>::value;
_LIBCPP_INLINE_VAR constexpr size_t is_placeholder_v = is_placeholder<_Tp>::value;
#endif
namespace placeholders
@@ -2020,16 +2020,16 @@ _LIBCPP_FUNC_VIS extern const __ph<8> _8;
_LIBCPP_FUNC_VIS extern const __ph<9> _9;
_LIBCPP_FUNC_VIS extern const __ph<10> _10;
#else
constexpr __ph<1> _1{};
constexpr __ph<2> _2{};
constexpr __ph<3> _3{};
constexpr __ph<4> _4{};
constexpr __ph<5> _5{};
constexpr __ph<6> _6{};
constexpr __ph<7> _7{};
constexpr __ph<8> _8{};
constexpr __ph<9> _9{};
constexpr __ph<10> _10{};
_LIBCPP_INLINE_VAR constexpr __ph<1> _1{};
_LIBCPP_INLINE_VAR constexpr __ph<2> _2{};
_LIBCPP_INLINE_VAR constexpr __ph<3> _3{};
_LIBCPP_INLINE_VAR constexpr __ph<4> _4{};
_LIBCPP_INLINE_VAR constexpr __ph<5> _5{};
_LIBCPP_INLINE_VAR constexpr __ph<6> _6{};
_LIBCPP_INLINE_VAR constexpr __ph<7> _7{};
_LIBCPP_INLINE_VAR constexpr __ph<8> _8{};
_LIBCPP_INLINE_VAR constexpr __ph<9> _9{};
_LIBCPP_INLINE_VAR constexpr __ph<10> _10{};
#endif // defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_BIND)
} // placeholders