[libcxx-commits] [libcxx] Make C++ 20 std::midpoint compatible with libc++ (PR #74217)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Dec 18 12:49:34 PST 2023
================
@@ -51,19 +51,12 @@ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
return __a + __half_diff;
}
-
template <class _TPtr>
-_LIBCPP_HIDE_FROM_ABI constexpr
-enable_if_t<is_pointer_v<_TPtr>
- && is_object_v<remove_pointer_t<_TPtr>>
- && ! is_void_v<remove_pointer_t<_TPtr>>
- && (sizeof(remove_pointer_t<_TPtr>) > 0), _TPtr>
-midpoint(_TPtr __a, _TPtr __b) noexcept
-{
- return __a + std::midpoint(ptrdiff_t(0), __b - __a);
+_LIBCPP_INLINE_VISIBILITY constexpr enable_if_t<is_object_v<_TPtr> && !is_void_v<_TPtr> && (sizeof(_TPtr) > 0), _TPtr*>
+midpoint(_TPtr* __a, _TPtr* __b) noexcept {
+ return __a + _VSTD::midpoint(ptrdiff_t(0), __b - __a);
----------------
ldionne wrote:
Please use `std::` instead of `_VSTD::`. I suspect those are incorrectly-resolved merge conflict artifacts.
https://github.com/llvm/llvm-project/pull/74217
More information about the libcxx-commits
mailing list