[libcxx-commits] [libcxx] [libc++] Optimize ranges::{for_each, for_each_n} for segmented iterators (PR #132896)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 4 09:59:00 PDT 2025


================
@@ -51,9 +51,12 @@ int main(int argc, char** argv) {
     bm.operator()<std::vector<int>>("std::for_each_n(vector<int>)", std_for_each_n);
     bm.operator()<std::deque<int>>("std::for_each_n(deque<int>)", std_for_each_n);
     bm.operator()<std::list<int>>("std::for_each_n(list<int>)", std_for_each_n);
+    bm.operator()<std::vector<int>>("rng::for_each_n(vector<int>)", std::ranges::for_each_n);
----------------
ldionne wrote:

Let's use the same numbers as for the `std::for_each` benchmarks.

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


More information about the libcxx-commits mailing list