Added assertion against broken usage of iterators,
...e.g. i != end which always return true when they are not from the same unit map.
This commit is contained in:
parent
f9990e113a
commit
5ee8a00f1a
1 changed files with 4 additions and 2 deletions
|
@ -143,8 +143,10 @@ public:
|
|||
bool valid() const
|
||||
{ return map_ && map_->is_valid(i_); }
|
||||
|
||||
bool operator==(const iterator_base& rhs) const { return i_ == rhs.i_; }
|
||||
bool operator!=(const iterator_base& rhs) const { return !operator==(rhs); }
|
||||
bool operator==(const iterator_base &rhs) const
|
||||
{ assert(map_ == rhs.map_); return i_ == rhs.i_; }
|
||||
bool operator!=(const iterator_base &rhs) const
|
||||
{ return !operator==(rhs); }
|
||||
|
||||
map_type* get_map() const { return map_; }
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue