Browse Source

Fixes to multilevelqueue's iterator.

nce_cpp
Fernando Sahmkow 7 years ago
committed by FernandoS27
parent
commit
15307bc4d1
  1. 6
      src/common/multi_level_queue.h

6
src/common/multi_level_queue.h

@ -35,7 +35,11 @@ public:
using difference_type = typename std::pointer_traits<pointer>::difference_type; using difference_type = typename std::pointer_traits<pointer>::difference_type;
friend bool operator==(const iterator_impl& lhs, const iterator_impl& rhs) { friend bool operator==(const iterator_impl& lhs, const iterator_impl& rhs) {
return (lhs.IsEnd() && rhs.IsEnd()) || lhs.it == rhs.it;
if (lhs.IsEnd() && rhs.IsEnd())
return true;
if (lhs.current_priority == rhs.current_priority)
return lhs.it == rhs.it;
return false;
} }
friend bool operator!=(const iterator_impl& lhs, const iterator_impl& rhs) { friend bool operator!=(const iterator_impl& lhs, const iterator_impl& rhs) {

Loading…
Cancel
Save