Skip to content

Conversation

philnik777
Copy link
Contributor

@philnik777 philnik777 commented Jul 25, 2025

This does multiple things:

  • if constexpr is used to simplify overload resolution
  • the segmented iterator optimization is always applied, not just for random access local iterators

@philnik777 philnik777 force-pushed the simplify_for_each_n branch from 04cb7c3 to ac6b3b0 Compare July 25, 2025 15:42
@github-actions
Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff HEAD~1 HEAD --extensions h -- libcxx/include/__algorithm/for_each_n.h libcxx/include/__algorithm/for_each_n_segment.h libcxx/include/__algorithm/ranges_for_each_n.h libcxx/include/__iterator/segmented_iterator.h libcxx/include/__iterator/unreachable_sentinel.h
View the diff from clang-format here.
diff --git a/libcxx/include/__iterator/unreachable_sentinel.h b/libcxx/include/__iterator/unreachable_sentinel.h
index 0351b88d4..543676d8a 100644
--- a/libcxx/include/__iterator/unreachable_sentinel.h
+++ b/libcxx/include/__iterator/unreachable_sentinel.h
@@ -22,7 +22,8 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-inline constexpr struct __unreachable_sentinel_t {} __unreachable_sentinel;
+inline constexpr struct __unreachable_sentinel_t {
+} __unreachable_sentinel;
 
 template <class _UnreachableSentinel,
           class _Iter,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant