Skip to content

Commit

Permalink
Make Chunk 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 bc94f6b commit c5c118b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/mcpp/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ struct Chunk {
pointer m_ptr;
};

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

/**
* Initialized by copying from a flat vector of blocks
Expand Down

0 comments on commit c5c118b

Please sign in to comment.