small changes in map insert and erase

This commit is contained in:
hugogogo
2022-06-29 14:39:36 +02:00
parent b0b63d6238
commit eeb3c7dfc0
4 changed files with 26 additions and 32 deletions

View File

@@ -83,8 +83,8 @@ public:
return old;
}
node<value_type>* getNode() { return _node; }
const node<value_type>* getNode() const { return _node; }
node<value_type>* get_node() { return _node; }
const node<value_type>* get_node() const { return _node; }
const sentinel<value_type>* getSentinel() const { return _sentinel; }
friend bool operator==(const self &lhs, const self &rhs) {
@@ -120,7 +120,7 @@ public:
const sentinel<value_type>* sentinel)
: _node(node), _sentinel(sentinel) {}
map_const_iterator (const map_iterator< Key, T, Compare, Allocator >& src)
: _node(src.getNode()), _sentinel(src.getSentinel()) {}
: _node(src.get_node()), _sentinel(src.getSentinel()) {}
reference operator*() const {
return _node->value; }
@@ -175,8 +175,7 @@ public:
return old;
}
node<value_type>* getNode() const {
return _node; }
node<value_type>* get_node() const { return _node; }
friend bool operator==(const self &lhs, const self &rhs) {
return lhs._node == rhs._node; }