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:
Christoph M. Wintersteiger 2016-07-28 18:07:48 +01:00
commit 6f874c5c1d
9 changed files with 127 additions and 7 deletions

View file

@ -218,6 +218,18 @@ public:
iterator const begin() const { return iterator(*this, false); }
iterator const end() const { return iterator(*this, true); }
unsigned get_hash() const {
unsigned h = 0;
for (unsigned i = 0; i < size(); ++i) {
h += (i+1)*((*this)[i]);
}
return h;
}
struct eq { bool operator()(uint_set const& s1, uint_set const& s2) const { return s1 == s2; } };
struct hash { unsigned operator()(uint_set const& s) const { return s.get_hash(); } };
};
inline std::ostream & operator<<(std::ostream & target, const uint_set & s) {