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

Lucas Mellone via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jul 18 15:19:40 PDT 2026


================
@@ -13,7 +13,7 @@
 //     constexpr iter_difference_t<I> ranges::distance(I first, S last);
 //
 // template<class I, sized_sentinel_for<decay_t<I>> S>
-//   constexpr iter_difference_t<I> ranges::distance(const I& first, S last);
+//   constexpr iter_difference_t<decay_t<I>> ranges::distance(I&& first, S last);
----------------
lknknm wrote:

According to the original implementation of `distance` in https://github.com/llvm/llvm-project/commit/c965d5448ecdf9a5513983862a78a2ba8f7fbab8 there is a workaround in the implementation and it states it should be reviewed when LWG3664 is resolved.
What is the context of this workaround specifically? Should `lwg3664.pass.cpp` be ported to `iterator_sentinel.pass.cpp`?

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


More information about the libcxx-commits mailing list