[libcxx-commits] [libcxx] [libc++] Avoid overloaded `operator, ` for (`T`, `Iter`) cases (PR #161049)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Nov 8 04:44:41 PST 2025
================
@@ -33,7 +33,7 @@ void test(InputIterator f, InputIterator l) {
assert(d.size() == static_cast<std::size_t>(std::distance(f, l)));
assert(static_cast<std::size_t>(std::distance(d.begin(), d.end())) == d.size());
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(d));
- for (const_iterator i = d.begin(), e = d.end(); i != e; ++i, ++f)
+ for (const_iterator i = d.begin(), e = d.end(); i != e; ++i, (void)++f)
assert(*i == *f);
----------------
frederick-vs-ja wrote:
Oh, now I think these tests are somehow buggy. They iterate on the ranges more than once, while the ranges may be input-only. Also, `std::all_of(d.begin(), d.end(), f)` doesn't work because the 3rd parameter needs to be a predicate.
https://github.com/llvm/llvm-project/pull/161049
More information about the libcxx-commits
mailing list