[libcxx-commits] [libcxx] [libc++][ranges] Fix `ranges::to` with ADL-only `begin`/`end` (PR #119161)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 20 14:32:48 PST 2025


================
@@ -109,8 +109,11 @@ template <class _Container, input_range _Range, class... _Args>
         __result.reserve(static_cast<range_size_t<_Container>>(ranges::size(__range)));
       }
 
-      for (auto&& __ref : __range) {
-        using _Ref = decltype(__ref);
+      auto __iter = ranges::begin(__range);
----------------
philnik777 wrote:

I also wonder whether this would improve interactions with `deque` iterators.

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


More information about the libcxx-commits mailing list