Skip to content

Commit

Permalink
friends
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed May 14, 2022
1 parent 5add3ce commit 7087763
Showing 1 changed file with 33 additions and 51 deletions.
84 changes: 33 additions & 51 deletions include/seqan3/utility/views/chunk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,27 +268,9 @@ class chunk_view<urng_t>::basic_input_iterator
}

//!\brief Compare to the sentinel type (same as sentinel type of the underlying range).
friend bool operator==(input_helper_iterator const & lhs, sentinel_t const & /* rhs */) noexcept
bool operator==(sentinel_t const & /* rhs */) noexcept
{
return (lhs.outer_it)->remaining == 0 || (lhs.outer_it)->urng_begin == (lhs.outer_it)->urng_end;
}

//!\brief Compare to the sentinel type (same as sentinel type of the underlying range).
friend bool operator==(sentinel_t const & lhs, input_helper_iterator const & rhs) noexcept
{
return rhs == lhs;
}

//!\brief Compare to the sentinel type (same as sentinel type of the underlying range).
friend bool operator!=(input_helper_iterator const & lhs, sentinel_t const & rhs) noexcept
{
return !(lhs == rhs);
}

//!\brief Compare to the sentinel type (same as sentinel type of the underlying range).
friend bool operator!=(sentinel_t const & lhs, input_helper_iterator const & rhs) noexcept
{
return !(lhs == rhs);
return this->outer_it->remaining == 0 || this->outer_it->urng_begin == this->outer_it->urng_end;
}

//!\brief Pointer to the outer iterator (basic_input_iterator).
Expand Down Expand Up @@ -372,35 +354,35 @@ class chunk_view<urng_t>::basic_input_iterator
return lhs.urng_begin == rhs;
}

//!\brief Compare to the sentinel type (same as sentinel type of the underlying range).
friend bool operator==(sentinel_t const & lhs, basic_input_iterator const & rhs) noexcept
{
return rhs == lhs;
}
// //!\brief Compare to the sentinel type (same as sentinel type of the underlying range).
// friend bool operator==(sentinel_t const & lhs, basic_input_iterator const & rhs) noexcept
// {
// return rhs == lhs;
// }

//!\brief Compare to another basic_input_iterator.
friend bool operator==(basic_input_iterator const & lhs, basic_input_iterator const & rhs) noexcept
{
return (lhs.urng_begin == rhs.urng_begin) && (lhs.remaining == rhs.remaining);
}

//!\brief Compare to the sentinel type (same as sentinel type of the underlying range).
friend bool operator!=(basic_input_iterator const & lhs, sentinel_t const & rhs) noexcept
{
return !(lhs == rhs);
}
// //!\brief Compare to the sentinel type (same as sentinel type of the underlying range).
// friend bool operator!=(basic_input_iterator const & lhs, sentinel_t const & rhs) noexcept
// {
// return !(lhs == rhs);
// }

//!\brief Compare to the sentinel type (same as sentinel type of the underlying range).
friend bool operator!=(sentinel_t const & lhs, basic_input_iterator const & rhs) noexcept
{
return !(lhs == rhs);
}
// //!\brief Compare to the sentinel type (same as sentinel type of the underlying range).
// friend bool operator!=(sentinel_t const & lhs, basic_input_iterator const & rhs) noexcept
// {
// return !(lhs == rhs);
// }

//!\brief Compare to another basic_input_iterator.
friend bool operator!=(basic_input_iterator const & lhs, basic_input_iterator const & rhs) noexcept
{
return !(lhs == rhs);
}
// //!\brief Compare to another basic_input_iterator.
// friend bool operator!=(basic_input_iterator const & lhs, basic_input_iterator const & rhs) noexcept
// {
// return !(lhs == rhs);
// }
//!\}

//!\brief Pre-increment.
Expand Down Expand Up @@ -434,7 +416,7 @@ class chunk_view<urng_t>::basic_input_iterator
//!\brief The chunk size, e.g. the length of the subrange returned by this iterator.
uint16_t chunk_size;

public:
// public:
//!\brief The remaining elements in the chunk.
uint16_t remaining;

Expand Down Expand Up @@ -548,11 +530,11 @@ class chunk_view<urng_t>::basic_iterator
return lhs.current_chunk.begin() == rhs;
}

//!\brief Compare to end of underlying range.
friend bool operator==(sentinel_t const & lhs, basic_iterator const & rhs) noexcept
{
return rhs == lhs;
}
// //!\brief Compare to end of underlying range.
// friend bool operator==(sentinel_t const & lhs, basic_iterator const & rhs) noexcept
// {
// return rhs == lhs;
// }

//!\brief Compare to another basic_iterator.
friend bool operator==(basic_iterator const & lhs, basic_iterator const & rhs) noexcept
Expand All @@ -566,11 +548,11 @@ class chunk_view<urng_t>::basic_iterator
return !(lhs == rhs);
}

//!\brief Compare to underlying range sentinal type.
friend bool operator!=(sentinel_t const & lhs, basic_iterator const & rhs) noexcept
{
return !(lhs == rhs);
}
// //!\brief Compare to underlying range sentinal type.
// friend bool operator!=(sentinel_t const & lhs, basic_iterator const & rhs) noexcept
// {
// return !(lhs == rhs);
// }

//!\brief Compare to another basic_iterator.
friend bool operator!=(basic_iterator const & lhs, basic_iterator const & rhs) noexcept
Expand Down

0 comments on commit 7087763

Please sign in to comment.