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

via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 22 14:53:40 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions ,cpp,h -- libcxx/include/__algorithm/for_each.h libcxx/include/__algorithm/for_each_n.h libcxx/include/__algorithm/ranges_for_each.h libcxx/include/__algorithm/ranges_for_each_n.h libcxx/include/experimental/iterator libcxx/include/mutex libcxx/include/shared_mutex libcxx/test/benchmarks/algorithms/nonmodifying/for_each.bench.cpp libcxx/test/benchmarks/algorithms/nonmodifying/for_each_n.bench.cpp libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/ranges.for_each.pass.cpp libcxx/test/std/algorithms/alg.nonmodifying/alg.foreach/ranges.for_each_n.pass.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/include/__algorithm/for_each_n.h b/libcxx/include/__algorithm/for_each_n.h
index 342b3dd1c..9a6c6bb51 100644
--- a/libcxx/include/__algorithm/for_each_n.h
+++ b/libcxx/include/__algorithm/for_each_n.h
@@ -18,8 +18,8 @@
 #include <__iterator/segmented_iterator.h>
 #include <__type_traits/disjunction.h>
 #include <__type_traits/enable_if.h>
-#include <__type_traits/negation.h>
 #include <__type_traits/invoke.h>
+#include <__type_traits/negation.h>
 #include <__utility/convert_to_integral.h>
 #include <__utility/move.h>
 

``````````

</details>


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


More information about the libcxx-commits mailing list