From 97228b567ac92f5a7e737f38719a0a0654aad72a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20G=C3=BCndling?= Date: Wed, 20 Mar 2024 16:21:26 +0100 Subject: [PATCH] paged vecvec cleanup --- include/cista/containers/paged_vecvec.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/include/cista/containers/paged_vecvec.h b/include/cista/containers/paged_vecvec.h index fc5d8e8b..f6b37658 100644 --- a/include/cista/containers/paged_vecvec.h +++ b/include/cista/containers/paged_vecvec.h @@ -15,7 +15,6 @@ struct paged_vecvec { struct const_bucket final { using size_type = typename Paged::size_type; - using index_value_type = typename Paged::page; using data_value_type = typename Paged::value_type; using value_type = data_value_type; @@ -36,15 +35,10 @@ struct paged_vecvec { return std::string_view{begin(), size()}; } - iterator begin() { return pv_->data(i_); } - iterator end() { return pv_->data(i_) + size(); } - friend iterator begin(const_bucket const& b) { return b.begin(); } - friend iterator end(const_bucket const& b) { return b.end(); } - - value_type& operator[](std::size_t const i) { - assert(i < size()); - return *(begin() + i); - } + const_iterator begin() const { return pv_->data(i_); } + const_iterator end() const { return pv_->data(i_) + size(); } + friend const_iterator begin(const_bucket const& b) { return b.begin(); } + friend const_iterator end(const_bucket const& b) { return b.end(); } value_type const& operator[](std::size_t const i) const { assert(i < size()); @@ -63,7 +57,7 @@ struct paged_vecvec { reference operator*() const { return *this; } - index_value_type size() const { return pv_->page(i_).size_; } + size_type size() const { return pv_->page(i_).size_; } friend bool operator==(const_bucket const& a, const_bucket const& b) { assert(a.pv_ == b.pv_);