Skip to content
Snippets Groups Projects
Verified Commit 954ffa81 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

C++20 modernization: use std::ranges::all_of

parent ae077e74
No related branches found
No related tags found
No related merge requests found
...@@ -217,7 +217,7 @@ IntSequence::add(int f, const IntSequence& s) ...@@ -217,7 +217,7 @@ IntSequence::add(int f, const IntSequence& s)
bool bool
IntSequence::isPositive() const IntSequence::isPositive() const
{ {
return std::all_of(data, data + length, [](int x) { return x >= 0; }); return std::ranges::all_of(data, data + length, [](int x) { return x >= 0; });
} }
bool bool
...@@ -225,7 +225,7 @@ IntSequence::isConstant() const ...@@ -225,7 +225,7 @@ IntSequence::isConstant() const
{ {
if (length < 2) if (length < 2)
return true; return true;
return std::all_of(data + 1, data + length, [this](int x) { return x == operator[](0); }); return std::ranges::all_of(data + 1, data + length, [this](int x) { return x == operator[](0); });
} }
bool bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment