#include "theory/bv/theory_bv_type_rules.h"
#include <ext/hash_set>
+#include <algorithm>
using namespace std;
using namespace CVC4::expr;
vector<NodeValue*> zombies;
zombies.reserve(d_zombies.size());
- std::copy(d_zombies.begin(),
- d_zombies.end(),
- std::back_inserter(zombies));
+ std::remove_copy_if(d_zombies.begin(),
+ d_zombies.end(),
+ std::back_inserter(zombies),
+ NodeValueReferenceCountNonZero());
d_zombies.clear();
for(vector<NodeValue*>::iterator i = zombies.begin();
friend class NodeManagerScope;
friend class expr::NodeValue;
+ /** Predicate for use with STL algorithms */
+ struct NodeValueReferenceCountNonZero {
+ bool operator()(expr::NodeValue* nv) { return nv->d_rc > 0; }
+ };
+
typedef __gnu_cxx::hash_set<expr::NodeValue*,
expr::NodeValuePoolHashFcn,
expr::NodeValuePoolEq> NodeValuePool;