3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00
This commit is contained in:
Jakob Rath 2022-10-04 14:08:44 +02:00
parent 3d27ec41d0
commit 9cc9d1fac4
5 changed files with 14 additions and 5 deletions

View file

@ -384,3 +384,11 @@ bool all_of(Container const& c, Predicate f)
using std::begin, std::end; // allows begin(c) to also find c.begin()
return std::all_of(begin(c), end(c), std::forward<Predicate>(f));
}
/** Compact version of std::count */
template <typename Container, typename Item>
std::size_t count(Container const& c, Item x)
{
using std::begin, std::end; // allows begin(c) to also find c.begin()
return std::count(begin(c), end(c), std::forward<Item>(x));
}