Overloaded equality operator
| 587 | |
| 588 | /// Overloaded equality operator |
| 589 | bool operator==(const Map<K,V>& map) const { |
| 590 | |
| 591 | if (size() != map.size()) return false; |
| 592 | |
| 593 | for (auto it = begin(); it != end(); ++it) { |
| 594 | auto it2 = map.find(it->first); |
| 595 | if (it2 == map.end() || it2->second != it->second) { |
| 596 | return false; |
| 597 | } |
| 598 | } |
| 599 | |
| 600 | for (auto it = map.begin(); it != map.end(); ++it) { |
| 601 | auto it2 = find(it->first); |
| 602 | if (it2 == end() || it2->second != it->second) { |
| 603 | return false; |
| 604 | } |
| 605 | } |
| 606 | |
| 607 | return true; |
| 608 | } |
| 609 | |
| 610 | /// Overloaded not equal operator |
| 611 | bool operator!=(const Map<K,V>& map) const { |