feat(util): add method get_rc (mainly for debugging purposes)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
c78e6787aa
commit
9a3959eed1
2 changed files with 4 additions and 0 deletions
|
@ -36,6 +36,8 @@ public:
|
|||
bool contains(K const & k) const { return m_map.contains(mk_pair(k, T())); }
|
||||
void erase(K const & k) { m_map.erase(mk_pair(k, T())); }
|
||||
|
||||
unsigned get_rc() const { return m_map.get_rc(); }
|
||||
|
||||
class ref {
|
||||
rb_map & m_map;
|
||||
K const & m_key;
|
||||
|
|
|
@ -287,6 +287,8 @@ public:
|
|||
rb_tree & operator=(rb_tree const & s) { m_root = s.m_root; return *this; }
|
||||
rb_tree & operator=(rb_tree && s) { m_root = s.m_root; return *this; }
|
||||
|
||||
unsigned get_rc() const { return m_root ? m_root->get_rc() : 0; }
|
||||
|
||||
void insert(T const & v) {
|
||||
m_root = set_black(insert(m_root.steal(), v));
|
||||
lean_assert(check_invariant());
|
||||
|
|
Loading…
Reference in a new issue