return *obj;
}
- void insert(const Key& k, const Data& d) {
+ bool insert(const Key& k, const Data& d) {
emptyTrash();
typename table_type::iterator i = d_map.find(k);
if(i == d_map.end()) {// create new object
Element* obj = new(true) Element(d_context, this, k, d);
d_map[k] = obj;
+ return true;
} else {
(*i).second->set(d);
+ return false;
}
}
#define __CVC4__CONTEXT__CDSET_H
#include "context/context.h"
+#include "context/cdmap.h"
#include "util/Assert.h"
namespace CVC4 {
return super::count(v);
}
- void insert(const V& v) {
- super::insert(v, v);
+ bool insert(const V& v) {
+ return super::insert(v, v);
+ }
+
+ bool contains(const V& v) {
+ return find(v) != end();
}
// FIXME: no erase(), too much hassle to implement efficiently...