38template <std::ranges::view urng_t>
44 template <
typename underlying_iter_t>
63 template <
typename viewable_rng_t>
65 && std::ranges::viewable_range<viewable_rng_t>
82 constexpr auto begin() const noexcept
82 constexpr auto begin() const noexcept {
…}
96 constexpr auto end() noexcept
98 if constexpr (std::ranges::common_range<urng_t>)
96 constexpr auto end() noexcept {
…}
105 constexpr auto end() const noexcept
108 if constexpr (std::ranges::common_range<urng_t>)
111 return std::ranges::cend(
urng);
105 constexpr auto end() const noexcept {
…}
126template <std::ranges::view urng_t>
128template <
typename underlying_iter_t>
146 using base_t::base_t;
166 using base_t::operator==;
167 using base_t::operator!=;
170 noexcept(
noexcept(std::declval<underlying_iter_t const &>()
171 == std::declval<std::ranges::sentinel_t<urng_t>
const &>()))
173 return lhs.base() == rhs;
178 noexcept(
noexcept(std::declval<underlying_iter_t const &>()
179 == std::declval<std::ranges::sentinel_t<urng_t>
const &>()))
186 noexcept(
noexcept(std::declval<underlying_iter_t const &>()
187 != std::declval<std::ranges::sentinel_t<urng_t>
const &>()))
189 return !(lhs == rhs);
194 noexcept(
noexcept(std::declval<underlying_iter_t const &>()
195 != std::declval<std::ranges::sentinel_t<urng_t>
const &>()))
205 using base_t::operator-;
209 noexcept(
noexcept(std::declval<underlying_iter_t const &>()
210 - std::declval<std::ranges::sentinel_t<urng_t>
const &>()))
211 requires std::sized_sentinel_for<std::ranges::sentinel_t<urng_t>, underlying_iter_t>
213 return this->base() - rhs;
219 noexcept(
noexcept(std::declval<std::ranges::sentinel_t<urng_t>
const &>()
220 - std::declval<underlying_iter_t const &>()))
221 requires std::sized_sentinel_for<std::ranges::sentinel_t<urng_t>, underlying_iter_t>
223 return lhs - rhs.
base();
233template <std::ranges::viewable_range rng_t>
250 using base_t::base_t;
259 template <std::ranges::viewable_range urng_t>
260 static constexpr auto impl(urng_t && urange)
263 "The adapted range must either model std::ranges::random_access_range or must be "
264 "a specific SeqAn range type that supports pseudo random access.");
265 static_assert(std::ranges::forward_range<urng_t>,
266 "The underlying range must model std::ranges::forward_range.");
268 if constexpr (std::ranges::random_access_range<urng_t>)
270 return std::views::all(std::forward<urng_t>(urange));
260 static constexpr auto impl(urng_t && urange) {
…}
Provides seqan3::detail::adaptor_base and seqan3::detail::combined_adaptor.
CRTP-base to simplify the definition of range adaptor closure objects and similar types.
Definition adaptor_base.hpp:74
A CRTP base template for creating iterators that inherit from other iterators.
Definition inherited_iterator_base.hpp:49
constexpr base_t const & base() const &noexcept
Get a const reference to the base.
Definition inherited_iterator_base.hpp:106
Iterator wrapper for the underlying range iterator enforcing std::random_access_iterator_tag.
Definition enforce_random_access.hpp:131
friend constexpr bool operator!=(basic_iterator const &lhs, std::ranges::sentinel_t< urng_t > const &rhs) noexcept(noexcept(std::declval< underlying_iter_t const & >() !=std::declval< std::ranges::sentinel_t< urng_t > const & >()))
Tests if iterator is not at the end.
Definition enforce_random_access.hpp:185
constexpr basic_iterator & operator=(basic_iterator &&)=default
Defaulted.
constexpr basic_iterator(basic_iterator const &)=default
Defaulted.
constexpr basic_iterator(basic_iterator &&)=default
Defaulted.
constexpr friend base_t::difference_type operator-(std::ranges::sentinel_t< urng_t > const &lhs, basic_iterator const &rhs) noexcept(noexcept(std::declval< std::ranges::sentinel_t< urng_t > const & >() - std::declval< underlying_iter_t const & >()))
Computes the distance betwen this iterator and the sentinel of the underlying range.
Definition enforce_random_access.hpp:217
constexpr basic_iterator()=default
Defaulted.
friend constexpr bool operator==(basic_iterator const &lhs, std::ranges::sentinel_t< urng_t > const &rhs) noexcept(noexcept(std::declval< underlying_iter_t const & >()==std::declval< std::ranges::sentinel_t< urng_t > const & >()))
Tests if iterator is at the end.
Definition enforce_random_access.hpp:169
~basic_iterator()=default
Defaulted.
constexpr basic_iterator & operator=(basic_iterator const &)=default
Defaulted.
friend constexpr bool operator!=(std::ranges::sentinel_t< urng_t > const &lhs, basic_iterator const &rhs) noexcept(noexcept(std::declval< underlying_iter_t const & >() !=std::declval< std::ranges::sentinel_t< urng_t > const & >()))
Tests if iterator is not at the end.
Definition enforce_random_access.hpp:193
friend constexpr bool operator==(std::ranges::sentinel_t< urng_t > const &lhs, basic_iterator const &rhs) noexcept(noexcept(std::declval< underlying_iter_t const & >()==std::declval< std::ranges::sentinel_t< urng_t > const & >()))
Tests if iterator is at the end.
Definition enforce_random_access.hpp:177
constexpr base_t::difference_type operator-(std::ranges::sentinel_t< urng_t > const &rhs) const noexcept(noexcept(std::declval< underlying_iter_t const & >() - std::declval< std::ranges::sentinel_t< urng_t > const & >()))
Computes the distance betwen this iterator and the sentinel of the underlying range.
Definition enforce_random_access.hpp:208
View to force random access range iterator for seqan3::pseudo_random_access_range.
Definition enforce_random_access.hpp:41
constexpr view_enforce_random_access & operator=(view_enforce_random_access const &)=default
Defaulted.
constexpr auto end() noexcept
Returns the sentinel to the end of the range.
Definition enforce_random_access.hpp:96
view_enforce_random_access(rng_t &&) -> view_enforce_random_access< std::views::all_t< rng_t > >
A deduction guide for the view class template.
constexpr view_enforce_random_access(view_enforce_random_access &&)=default
Defaulted.
constexpr auto end() const noexcept
Returns the sentinel to the end of the range.
Definition enforce_random_access.hpp:105
constexpr view_enforce_random_access()=default
Defaulted.
constexpr view_enforce_random_access(viewable_rng_t &&range)
Construction from the underlying viewable range.
Definition enforce_random_access.hpp:67
urng_t urng
The underlying range.
Definition enforce_random_access.hpp:115
constexpr auto begin() const noexcept
Returns the iterator to the begin of the range.
Definition enforce_random_access.hpp:82
~view_enforce_random_access()=default
Defaulted.
constexpr view_enforce_random_access(urng_t &&range)
Construction from the underlying view.
Definition enforce_random_access.hpp:59
constexpr view_enforce_random_access & operator=(view_enforce_random_access &&)=default
Defaulted.
constexpr auto begin() noexcept
Returns the iterator to the begin of the range.
Definition enforce_random_access.hpp:76
constexpr view_enforce_random_access(view_enforce_random_access const &)=default
Defaulted.
constexpr auto enforce_random_access
A view adaptor that converts a pseudo random access range to a std::ranges::random_access_range.
Definition enforce_random_access.hpp:351
Provides the seqan3::detail::inherited_iterator_base template.
Specifies requirements of an input range type for which the const version of that type satisfies the ...
This concept checks if a type models a pseudo random access range.
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
The SeqAn namespace for views.
Definition char_strictly_to.hpp:19
SeqAn specific customisations in the standard namespace.
View adaptor definition for seqan3::views::enforce_random_access.
Definition enforce_random_access.hpp:243
static constexpr auto impl(urng_t &&urange)
Call the view's constructor with the underlying view as argument.
Definition enforce_random_access.hpp:260
friend base_t
Befriend the base class so it can call impl().
Definition enforce_random_access.hpp:254
Additional non-standard concepts for ranges.