[llvm] [ADT] Refactor Bitset to Be More Constexpr-Usable and Add More Member Functions (PR #172062)
Jakub Kuderski via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 16 10:48:28 PST 2025
================
@@ -1734,22 +1734,31 @@ UnaryFunction for_each(R &&Range, UnaryFunction F) {
/// Provide wrappers to std::all_of which take ranges instead of having to pass
/// begin/end explicitly.
template <typename R, typename UnaryPredicate>
-bool all_of(R &&Range, UnaryPredicate P) {
- return std::all_of(adl_begin(Range), adl_end(Range), P);
+constexpr bool all_of(R &&Range, UnaryPredicate P) {
+ for (auto &&Element : Range)
+ if (!P(std::forward<decltype(Element)>(Element)))
+ return false;
+ return true;
----------------
kuhar wrote:
Could you move the STExtras changes to a separate PR? This should be easy to review and land.
https://github.com/llvm/llvm-project/pull/172062
More information about the llvm-commits
mailing list