Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarfovich committed Sep 12, 2024
1 parent c2041e2 commit ed63ec4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions HW3/cc_lib/include/cc/forward_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ class ForwardList
ForwardList();

allocator_type get_allocator() const noexcept;
iterator before_begin() const;
iterator before_begin();
const_iterator cbefore_begin() const;
iterator begin() const;
iterator begin();
const_iterator cbegin() const;
iterator end() const;
iterator end();
const_iterator cend() const;
iterator insert_after(iterator position, const value_type& value);
bool empty() const noexcept;
Expand Down Expand Up @@ -146,9 +146,9 @@ auto ForwardList<T, Allocator>::insert_after(iterator position, const value_type
}

template<typename T, typename Allocator>
auto ForwardList<T, Allocator>::before_begin() const -> iterator
auto ForwardList<T, Allocator>::before_begin() -> iterator
{
return { this, const_cast<details::Node*>(&head) };
return { this, &head };
}

template<typename T, typename Allocator>
Expand All @@ -158,27 +158,27 @@ auto ForwardList<T, Allocator>::cbefore_begin() const -> const_iterator
}

template<typename T, typename Allocator>
auto ForwardList<T, Allocator>::begin() const -> iterator
auto ForwardList<T, Allocator>::begin() -> iterator
{
return std::next(before_begin());
}

template<typename T, typename Allocator>
auto ForwardList<T, Allocator>::cbegin() const -> const_iterator
{
return this->begin();
return begin();
}

template<typename T, typename Allocator>
auto ForwardList<T, Allocator>::end() const -> iterator
auto ForwardList<T, Allocator>::end() -> iterator
{
return { this };
}

template<typename T, typename Allocator>
auto ForwardList<T, Allocator>::cend() const -> const_iterator
{
return this->end();
return end();
}

template<typename T, typename Allocator>
Expand Down

0 comments on commit ed63ec4

Please sign in to comment.