feat(util/rb_map): add erase_min
This commit is contained in:
parent
c1392e60be
commit
1d39b6d5d4
1 changed files with 7 additions and 0 deletions
|
@ -38,6 +38,13 @@ public:
|
||||||
|
|
||||||
unsigned get_rc() const { return m_map.get_rc(); }
|
unsigned get_rc() const { return m_map.get_rc(); }
|
||||||
|
|
||||||
|
T erase_min() {
|
||||||
|
lean_assert(!empty());
|
||||||
|
T r = m_map.min()->second;
|
||||||
|
m_map.erase_min();
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
class ref {
|
class ref {
|
||||||
rb_map & m_map;
|
rb_map & m_map;
|
||||||
K const & m_key;
|
K const & m_key;
|
||||||
|
|
Loading…
Reference in a new issue