From 8aa9206a0856595fb6e84e00724b4a3927a2cb04 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Thu, 24 Feb 2022 10:07:45 -0600 Subject: [PATCH] Make KeyAddrBitfield class const-correct Signed-off-by: Michael Richters --- src/kaleidoscope/KeyAddrBitfield.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kaleidoscope/KeyAddrBitfield.h b/src/kaleidoscope/KeyAddrBitfield.h index bd764ca3..8d612a66 100644 --- a/src/kaleidoscope/KeyAddrBitfield.h +++ b/src/kaleidoscope/KeyAddrBitfield.h @@ -109,16 +109,16 @@ class KeyAddrBitfield { class Iterator; friend class KeyAddrBitfield::Iterator; - Iterator begin() { + Iterator begin() const { return Iterator{*this, 0}; } - Iterator end() { + Iterator end() const { return Iterator{*this, total_blocks}; } class Iterator { public: - Iterator(KeyAddrBitfield &bitfield, uint8_t x) + Iterator(const KeyAddrBitfield &bitfield, uint8_t x) : bitfield_(bitfield), block_index_(x) {} bool operator!=(const Iterator &other) { @@ -163,7 +163,7 @@ class KeyAddrBitfield { } private: - KeyAddrBitfield &bitfield_; + const KeyAddrBitfield &bitfield_; uint8_t block_index_; // index of the block uint8_t bit_index_{0}; // bit index in the block uint8_t block_;