diff options
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__algorithm/half_positive.h')
| -rw-r--r-- | contrib/llvm-project/libcxx/include/__algorithm/half_positive.h | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/contrib/llvm-project/libcxx/include/__algorithm/half_positive.h b/contrib/llvm-project/libcxx/include/__algorithm/half_positive.h index 5a0f4baf6aaa..2315e154fb2e 100644 --- a/contrib/llvm-project/libcxx/include/__algorithm/half_positive.h +++ b/contrib/llvm-project/libcxx/include/__algorithm/half_positive.h @@ -22,25 +22,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD // Perform division by two quickly for positive integers (llvm.org/PR39129) -template <typename _Integral> -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR -typename enable_if -< - is_integral<_Integral>::value, - _Integral ->::type +template <typename _Integral, __enable_if_t<is_integral<_Integral>::value, int> = 0> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR +_Integral __half_positive(_Integral __value) { return static_cast<_Integral>(static_cast<__make_unsigned_t<_Integral> >(__value) / 2); } -template <typename _Tp> -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR -typename enable_if -< - !is_integral<_Tp>::value, - _Tp ->::type +template <typename _Tp, __enable_if_t<!is_integral<_Tp>::value, int> = 0> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR +_Tp __half_positive(_Tp __value) { return __value / 2; |
