[libcxx-commits] [libcxx] [libc++][ranges] Fix `ranges::to` with ADL-only `begin`/`end` (PR #119161)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jan 20 11:51:13 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);
----------------
ldionne wrote:
I would suggest we use `ranges::for_each` instead, that seems cleaner and I don't think saving an include dependency is worth the added code complexity.
https://github.com/llvm/llvm-project/pull/119161
More information about the libcxx-commits
mailing list