Skip to content

Commit

Permalink
Make HeightMap iterator work when const
Browse files Browse the repository at this point in the history
  • Loading branch information
dxrcy committed Dec 3, 2024
1 parent c5c118b commit 643f71d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/mcpp/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,9 @@ struct HeightMap {
pointer m_ptr;
};

Iterator begin() { return Iterator(&raw_heights[0]); }
Iterator end() { return Iterator(&raw_heights[_x_len * _z_len]); }
Iterator begin() const { return Iterator(&raw_heights[0]); }
Iterator end() const { return Iterator(&raw_heights[_x_len * _z_len]); }

HeightMap(const Coordinate& loc1, const Coordinate& loc2,
const std::vector<int>& heights);

Expand Down

0 comments on commit 643f71d

Please sign in to comment.