summaryrefslogtreecommitdiffhomepage
path: root/src/tile-iterator.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tile-iterator.hpp')
-rw-r--r--src/tile-iterator.hpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/tile-iterator.hpp b/src/tile-iterator.hpp
index 5d999716..dcec01ab 100644
--- a/src/tile-iterator.hpp
+++ b/src/tile-iterator.hpp
@@ -15,6 +15,15 @@ struct tile_iterator_tuple final { // NOLINT(cppcoreguidelines-pro-type-member-i
local_coords pt;
};
+struct tile_const_iterator_tuple final { // NOLINT(cppcoreguidelines-pro-type-member-init)
+ const tile_const_iterator_tuple* operator->() const noexcept { return this; }
+ tile_const_iterator_tuple* operator->() noexcept { return this; }
+
+ tile_proto x;
+ std::size_t k;
+ local_coords pt;
+};
+
class tile_iterator final {
chunk* c;
std::size_t pos;
@@ -34,4 +43,23 @@ public:
tile_iterator_tuple operator*() noexcept;
};
+class tile_const_iterator final {
+ const chunk* c;
+ std::size_t pos;
+
+ friend bool operator==(const tile_const_iterator&, const tile_const_iterator&) noexcept;
+
+public:
+ explicit tile_const_iterator(const chunk& c, std::size_t pos) noexcept;
+ tile_const_iterator(const tile_const_iterator&) noexcept;
+ tile_const_iterator& operator=(const tile_const_iterator&) noexcept;
+
+ void swap(tile_const_iterator& other) noexcept;
+
+ tile_const_iterator& operator++() noexcept;
+ tile_const_iterator operator++(int) noexcept;
+ tile_const_iterator_tuple operator->() noexcept;
+ tile_const_iterator_tuple operator*() noexcept;
+};
+
} // namespace floormat