mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
count
This commit is contained in:
parent
3d27ec41d0
commit
9cc9d1fac4
5 changed files with 14 additions and 5 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue