diff options
-rw-r--r-- | day03.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/day03.cc b/day03.cc index efaffc0..fef7c92 100644 --- a/day03.cc +++ b/day03.cc @@ -7,6 +7,7 @@ using namespace std; class SpiralIterator : public std::iterator<std::input_iterator_tag, int> { + struct SpiralInfinity { }; public: pair<int, int> p; int i, j, d; @@ -15,8 +16,8 @@ public: { } auto begin() { return *this; } - auto end() { return SpiralIterator{}; } - bool operator!=(SpiralIterator &) const { return true; } // infinite + auto end() { return SpiralInfinity{}; } + bool operator!=(SpiralInfinity) const { return true; } // infinite auto operator*() { return p; } auto operator++() { |