Skip to content

Commit

Permalink
paged vecvec cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Mar 20, 2024
1 parent ea98b07 commit 97228b5
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions include/cista/containers/paged_vecvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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());
Expand All @@ -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_);
Expand Down

0 comments on commit 97228b5

Please sign in to comment.