[libcxx-commits] [PATCH] D127577: [libc++] Fix std::lower_bound with C++20-hostile iterators

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jun 12 14:45:23 PDT 2022


philnik added inline comments.


================
Comment at: libcxx/include/__iterator/distance.h:108
 _LIBCPP_CONSTEXPR_AFTER_CXX11
 typename iterator_traits<_Iter>::difference_type __ranges_distance(_Iter __first, _Sent __second) {
 #if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
----------------
EricWF wrote:
> Is it the case that `iterator_traits<_Iter>::difference_type` is always the same type as `std::iter_distance_t<_Iter>`? It's not obvious that it is a requirement.
I'm not sure. Might be another bug. I'm switching to a policy-based solution, so this shouldn't be a problem.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127577/new/

https://reviews.llvm.org/D127577



More information about the libcxx-commits mailing list