diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2023-12-18 20:30:12 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2024-04-19 21:12:03 +0000 |
| commit | c9157d925c489f07ba9c0b2ce47e5149b75969a5 (patch) | |
| tree | 08bc4a3d9cad3f9ebffa558ddf140b9d9257b219 /contrib/llvm-project/libcxx/include/__algorithm/half_positive.h | |
| parent | 2a66844f606a35d68ad8a8061f4bea204274b3bc (diff) | |
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; |
