Commit 227b1cd5 authored by Max Lyon's avatar Max Lyon

add count_if to smart ranges

parent b88a6c9d
Pipeline #13737 passed with stages
in 176 minutes and 6 seconds
......@@ -353,7 +353,16 @@ struct SmartRangeT
}
template <typename Functor>
auto count_if(Functor&& f) -> int
{
int count = 0;
auto range = static_cast<const RangeT*>(this);
for (const auto& e : *range)
if (f(e))
++count;
return count;
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment