Fix, MSVC's std::sort fails on Zip2Iterator

This commit is contained in:
Benjamin Doherty
2021-07-09 15:04:27 -07:00
committed by Mathias Agopian
parent 62787de97b
commit 26c9732b4e
2 changed files with 49 additions and 7 deletions
+2 -5
View File
@@ -51,7 +51,6 @@ public:
using value_type = std::pair<Val1, Val2>;
using reference = Ref;
using pointer = value_type*;
using difference_type = ptrdiff_t;
using iterator_category = std::random_access_iterator_tag;
@@ -60,11 +59,9 @@ public:
Zip2Iterator(Zip2Iterator const& rhs) noexcept = default;
Zip2Iterator& operator=(Zip2Iterator const& rhs) = default;
value_type operator*() const { return { *mIt.first, *mIt.second }; }
reference operator*() { return { *mIt.first, *mIt.second }; }
reference operator*() const { return { *mIt.first, *mIt.second }; }
const value_type operator[](size_t n) const { return *(*this + n); }
reference operator[](size_t n) { return *(*this + n); }
reference operator[](size_t n) const { return *(*this + n); }
Zip2Iterator& operator++() {
++mIt.first;