mirror of
https://github.com/Z3Prover/z3
synced 2025-06-27 08:28:44 +00:00
code simplification
This commit is contained in:
parent
a143ed3bff
commit
a5e5a35755
6 changed files with 34 additions and 38 deletions
|
@ -388,6 +388,14 @@ bool all_of(S const& set, T const& p) {
|
|||
return false;
|
||||
return true;
|
||||
}
|
||||
template<typename S, typename T>
|
||||
void filter(S& v, T const& p) {
|
||||
unsigned i = 0;
|
||||
for (auto const& e: v)
|
||||
if (p(e))
|
||||
v[i++] = e;
|
||||
v.shrink(i);
|
||||
}
|
||||
|
||||
template<typename S, typename T>
|
||||
bool xor_of(S const& set, T const& p) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue