From 708776388be3443da73a45b374a1880c7abe4046 Mon Sep 17 00:00:00 2001 From: Enrico Seiler Date: Sat, 14 May 2022 21:25:24 +0200 Subject: [PATCH] friends --- include/seqan3/utility/views/chunk.hpp | 84 ++++++++++---------------- 1 file changed, 33 insertions(+), 51 deletions(-) diff --git a/include/seqan3/utility/views/chunk.hpp b/include/seqan3/utility/views/chunk.hpp index 8957fcb1ff4..f0a4f15a30f 100644 --- a/include/seqan3/utility/views/chunk.hpp +++ b/include/seqan3/utility/views/chunk.hpp @@ -268,27 +268,9 @@ class chunk_view::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). @@ -372,11 +354,11 @@ class chunk_view::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 @@ -384,23 +366,23 @@ class chunk_view::basic_input_iterator 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. @@ -434,7 +416,7 @@ class chunk_view::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; @@ -548,11 +530,11 @@ class chunk_view::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 @@ -566,11 +548,11 @@ class chunk_view::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