Skip to content

Commit

Permalink
First pass of unified basic map interface + complex adapter layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobobalink committed Jan 18, 2024
1 parent 171b1bd commit 940a115
Show file tree
Hide file tree
Showing 9 changed files with 2,607 additions and 23 deletions.
5 changes: 5 additions & 0 deletions include/fixed_containers/bidirectional_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ class BidirectionalIterator
return out;
}

constexpr const EntryProvider& reference_provider() const
{
return reference_provider_;
}

private:
constexpr void advance() noexcept
{
Expand Down
12 changes: 6 additions & 6 deletions include/fixed_containers/fixed_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class FixedMap
{
if (current_index_ == NULL_INDEX)
{
current_index_ = tree_->index_of_min_at();
current_index_ = tree_->index_of_min_at().i;
}
else
{
Expand All @@ -104,7 +104,7 @@ class FixedMap
{
if (current_index_ == MAXIMUM_SIZE)
{
current_index_ = tree_->index_of_max_at();
current_index_ = tree_->index_of_max_at().i;
}
else
{
Expand Down Expand Up @@ -240,11 +240,11 @@ class FixedMap

constexpr const_iterator cbegin() const noexcept
{
return create_const_iterator(tree().index_of_min_at());
return create_const_iterator(tree().index_of_min_at().i);
}
constexpr const_iterator cend() const noexcept { return create_const_iterator(MAXIMUM_SIZE); }
constexpr const_iterator begin() const noexcept { return cbegin(); }
constexpr iterator begin() noexcept { return create_iterator(tree().index_of_min_at()); }
constexpr iterator begin() noexcept { return create_iterator(tree().index_of_min_at().i); }
constexpr const_iterator end() const noexcept { return cend(); }
constexpr iterator end() noexcept { return create_iterator(MAXIMUM_SIZE); }

Expand All @@ -256,12 +256,12 @@ class FixedMap
}
constexpr reverse_iterator rend() noexcept
{
return create_reverse_iterator(tree().index_of_min_at());
return create_reverse_iterator(tree().index_of_min_at().i);
}
constexpr const_reverse_iterator rend() const noexcept { return crend(); }
constexpr const_reverse_iterator crend() const noexcept
{
return create_const_reverse_iterator(tree().index_of_min_at());
return create_const_reverse_iterator(tree().index_of_min_at().i);
}

[[nodiscard]] constexpr std::size_t size() const noexcept { return tree().size(); }
Expand Down
Loading

0 comments on commit 940a115

Please sign in to comment.