mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 03:32:35 +08:00
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:
@@ -63,17 +63,17 @@ typedef ratio< 1000000000000000000000, 1> zetta; // not supported
|
||||
typedef ratio<1000000000000000000000000, 1> yotta; // not supported
|
||||
|
||||
// 20.11.5, ratio comparison
|
||||
template <class R1, class R2> constexpr bool ratio_equal_v
|
||||
template <class R1, class R2> inline constexpr bool ratio_equal_v
|
||||
= ratio_equal<R1, R2>::value; // C++17
|
||||
template <class R1, class R2> constexpr bool ratio_not_equal_v
|
||||
template <class R1, class R2> inline constexpr bool ratio_not_equal_v
|
||||
= ratio_not_equal<R1, R2>::value; // C++17
|
||||
template <class R1, class R2> constexpr bool ratio_less_v
|
||||
template <class R1, class R2> inline constexpr bool ratio_less_v
|
||||
= ratio_less<R1, R2>::value; // C++17
|
||||
template <class R1, class R2> constexpr bool ratio_less_equal_v
|
||||
template <class R1, class R2> inline constexpr bool ratio_less_equal_v
|
||||
= ratio_less_equal<R1, R2>::value; // C++17
|
||||
template <class R1, class R2> constexpr bool ratio_greater_v
|
||||
template <class R1, class R2> inline constexpr bool ratio_greater_v
|
||||
= ratio_greater<R1, R2>::value; // C++17
|
||||
template <class R1, class R2> constexpr bool ratio_greater_equal_v
|
||||
template <class R1, class R2> inline constexpr bool ratio_greater_equal_v
|
||||
= ratio_greater_equal<R1, R2>::value; // C++17
|
||||
}
|
||||
*/
|
||||
@@ -501,22 +501,28 @@ struct __ratio_gcd
|
||||
};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
|
||||
template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_equal_v
|
||||
template <class _R1, class _R2>
|
||||
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool ratio_equal_v
|
||||
= ratio_equal<_R1, _R2>::value;
|
||||
|
||||
template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_not_equal_v
|
||||
template <class _R1, class _R2>
|
||||
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool ratio_not_equal_v
|
||||
= ratio_not_equal<_R1, _R2>::value;
|
||||
|
||||
template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_less_v
|
||||
template <class _R1, class _R2>
|
||||
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool ratio_less_v
|
||||
= ratio_less<_R1, _R2>::value;
|
||||
|
||||
template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_less_equal_v
|
||||
template <class _R1, class _R2>
|
||||
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool ratio_less_equal_v
|
||||
= ratio_less_equal<_R1, _R2>::value;
|
||||
|
||||
template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_greater_v
|
||||
template <class _R1, class _R2>
|
||||
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool ratio_greater_v
|
||||
= ratio_greater<_R1, _R2>::value;
|
||||
|
||||
template <class _R1, class _R2> _LIBCPP_CONSTEXPR bool ratio_greater_equal_v
|
||||
template <class _R1, class _R2>
|
||||
_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool ratio_greater_equal_v
|
||||
= ratio_greater_equal<_R1, _R2>::value;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user