[libcxx-commits] [libcxx] [libc++][numeric] Modernized `std::midpoint` (PR #174596)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 6 07:09:42 PST 2026


================
@@ -35,8 +34,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 #if _LIBCPP_STD_VER >= 20
 template <class _Tp>
-_LIBCPP_HIDE_FROM_ABI constexpr enable_if_t<is_integral_v<_Tp> && !is_same_v<bool, _Tp> && !is_null_pointer_v<_Tp>, _Tp>
-midpoint(_Tp __a, _Tp __b) noexcept _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK {
+  requires(is_integral_v<_Tp> && !is_same_v<bool, _Tp> && !is_null_pointer_v<_Tp>)
----------------
eiytoq wrote:

`!is_null_pointer_v<_Tp>` is redundant under `is_integral_v<_Tp>`. Can we drop it?

https://github.com/llvm/llvm-project/pull/174596


More information about the libcxx-commits mailing list