From c5c118bdf8db126ddcb0d5337cd2210ccdcfa4c4 Mon Sep 17 00:00:00 2001 From: darcy Date: Tue, 3 Dec 2024 19:21:52 +1100 Subject: [PATCH] Make `Chunk` iterator work when `const` --- include/mcpp/util.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/mcpp/util.h b/include/mcpp/util.h index e503b43..e03d94f 100644 --- a/include/mcpp/util.h +++ b/include/mcpp/util.h @@ -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