[libcxx-commits] [libcxx] [libcxx] Optimize `ranges::fold_left_with_iter` for segmented iterators (PR #177853)

Connector Switch via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 29 01:19:33 PST 2026


c8ef wrote:

> Please add tests for this and benchmarks, as well as their numbers.

For the benchmark, I directly reused the `fold_left` algorithm benchmarks.

https://github.com/llvm/llvm-project/blob/d8da229d7172700f4f93fafe3ac22144ca04f6e9/libcxx/test/benchmarks/algorithms/nonmodifying/fold.bench.cpp#L60

Regarding the tests, the current `fold_left` tests seem to already cover `std::deque` iterators.

https://github.com/llvm/llvm-project/blob/d8da229d7172700f4f93fafe3ac22144ca04f6e9/libcxx/test/std/algorithms/alg.nonmodifying/alg.fold/left_folds.pass.cpp#L315

Are the test cases and benchmarks above sufficient?

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


More information about the libcxx-commits mailing list