[libcxx-commits] [libcxx] [libc++][ranges] Mark LWG3664 as resolved (PR #210550)

Lucas Mellone via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 21 02:31:13 PDT 2026


================
@@ -86,11 +86,11 @@ struct __distance {
   }
 
   template <class _Ip, sized_sentinel_for<decay_t<_Ip>> _Sp>
-  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip&& __first, _Sp __last) const {
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<decay_t<_Ip>> operator()(_Ip&& __first, _Sp __last) const {
     if constexpr (sized_sentinel_for<_Sp, __remove_cvref_t<_Ip>>) {
       return __last - __first;
     } else {
-      return __last - decay_t<_Ip>(__first);
+      return __last - static_cast<decay_t<_Ip>>(__first);
----------------
lknknm wrote:

I just reverted the changes. I kept the tests unified inside `range.iter.ops.distance/iterator_sentinel.pass.cpp`.

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


More information about the libcxx-commits mailing list