[libcxx-commits] [libcxx] [libc++][ranges] Resolve LWG4242 (PR #211568)

Lucas Mellone via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 6 08:44:08 PDT 2026


================
@@ -142,7 +142,7 @@
 "`LWG4235 <https://wg21.link/LWG4235>`__","``cache_latest_view`` and ``to_input_view`` miss ``reserve_hint``","2025-06 (Sofia)","","","`#148219 <https://github.com/llvm/llvm-project/issues/148219>`__",""
 "`LWG4236 <https://wg21.link/LWG4236>`__","``chunk_view::outer-iterator::value_type`` should provide ``reserve_hint``","2025-06 (Sofia)","","","`#148220 <https://github.com/llvm/llvm-project/issues/148220>`__",""
 "`LWG4239 <https://wg21.link/LWG4239>`__","``flat_map``'s transparent comparator no longer works for string literals","2025-06 (Sofia)","","","`#148223 <https://github.com/llvm/llvm-project/issues/148223>`__",""
-"`LWG4242 <https://wg21.link/LWG4242>`__","``ranges::distance`` does not work with volatile iterators","2025-06 (Sofia)","","","`#148224 <https://github.com/llvm/llvm-project/issues/148224>`__",""
+"`LWG4242 <https://wg21.link/LWG4242>`__","``ranges::distance`` does not work with volatile iterators","2025-06 (Sofia)","|Complete|","24","`#148224 <https://github.com/llvm/llvm-project/issues/148224>`__",""
----------------
lknknm wrote:

I think your reasoning makes sense. In the current implementation we don't have the hard error thrown like it's stated in the DR: https://godbolt.org/z/78G64n6qs

I'm just trying to understand which one is more restrictive. IIUC the current implementation is slightly more restrictive than the `!is_array_v<remove_reference_t<_Ip>>` one. Do we want it to keep it more restrictive?

I think in the least we should leave a comment in this `operator()` signalling that with the current implementation we are satisfying both LWG3664 and LWG4242. 

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


More information about the libcxx-commits mailing list