30 template <
typename view_t>
31 class single_pass_input_iterator;
38 template <std::ranges::View urng_t>
49 template <
typename view_t>
50 friend class single_pass_input_iterator;
68 using iterator = single_pass_input_iterator<single_pass_input_view>;
71 using const_iterator = void;
75 using value_type =
typename iterator::value_type;
77 using reference =
typename iterator::reference;
79 using const_reference = void;
86 constexpr single_pass_input_view() =
default;
89 constexpr single_pass_input_view(single_pass_input_view
const &) =
default;
91 constexpr single_pass_input_view(single_pass_input_view &&) =
default;
93 constexpr single_pass_input_view & operator=(single_pass_input_view
const &) =
default;
95 constexpr single_pass_input_view & operator=(single_pass_input_view &&) =
default;
97 ~single_pass_input_view() =
default;
100 explicit single_pass_input_view(urng_t _urng) :
101 state_ptr{
new state{std::move(_urng)}}
105 template <
typename other_urng_t>
111 explicit single_pass_input_view(other_urng_t && _urng) :
128 return iterator{*
this};
132 const_iterator
begin()
const =
delete;
135 const_iterator
cbegin()
const =
delete;
144 sentinel
end()
const =
delete;
147 sentinel
cend()
const =
delete;
156 template <std::ranges::ViewableRange urng_t>
158 single_pass_input_view(urng_t &&) ->
159 single_pass_input_view<std::ranges::all_view<urng_t>>;
176 template <
typename view_type>
177 class single_pass_input_iterator<single_pass_input_view<view_type>>
180 using base_iterator_type =
typename single_pass_input_view<view_type>::urng_iterator_type;
182 using sentinel_type =
typename single_pass_input_view<view_type>::sentinel;
185 single_pass_input_view<view_type> * view_ptr{};
188 template <
typename input_view_type>
189 friend class single_pass_input_iterator;
199 using difference_type = difference_type_t<base_iterator_type>;
202 using value_type = value_type_t<base_iterator_type>;
206 using reference = reference_t<base_iterator_type>;
214 single_pass_input_iterator() =
default;
217 constexpr single_pass_input_iterator(single_pass_input_iterator
const & rhs) =
default;
219 constexpr single_pass_input_iterator(single_pass_input_iterator && rhs) =
default;
221 constexpr single_pass_input_iterator & operator=(single_pass_input_iterator
const & rhs) =
default;
223 constexpr single_pass_input_iterator & operator=(single_pass_input_iterator && rhs) =
default;
225 ~single_pass_input_iterator() =
default;
228 single_pass_input_iterator(single_pass_input_view<view_type> &
view) noexcept : view_ptr{&
view}
235 reference operator*() const noexcept
242 pointer operator->() const noexcept
244 requires !
std::is_void_v<pointer>
254 single_pass_input_iterator & operator++() noexcept
262 auto operator++(
int) noexcept
267 single_pass_input_iterator tmp{*
this};
281 constexpr
bool operator==(sentinel_type
const & s)
const noexcept
284 return cached() == s;
288 friend constexpr
bool 289 operator==(sentinel_type
const & s,
290 single_pass_input_iterator<single_pass_input_view<view_type>>
const & rhs) noexcept
296 constexpr
bool operator!=(sentinel_type
const & rhs)
const noexcept
298 return !(*
this == rhs);
302 friend constexpr
bool 304 single_pass_input_iterator<single_pass_input_view<view_type>>
const & rhs) noexcept
313 base_iterator_type & cached() const noexcept
315 return view_ptr->state_ptr->cached_urng_iter;
381 inline constexpr
auto single_pass_input = detail::adaptor_for_view_without_args<detail::single_pass_input_view>{};
::ranges::cbegin cbegin
Alias for ranges::cbegin. Returns an iterator to the beginning of a range.
Definition: ranges:209
Specifies the requirements of a Range type that is either a std::ranges::View or an lvalue-reference...
Provides C++20 additions to the <iterator> header.
Provides various shortcuts for common std::ranges functions.
SeqAn specific customisations in the standard namespace.
constexpr auto all
A view adaptor that behaves like std::view:all, but type erases contiguous ranges.
Definition: view_all.hpp:160
The concept std::CopyConstructible is satisfied if T is an lvalue reference type, or if it is a MoveC...
::ranges::view_interface< urng_t > view_interface
Alias for ranges::view_interface.
Definition: ranges:220
Provides various type traits.
The Sentinel concept specifies the relationship between an std::Iterator type and a std::Semiregular ...
Auxiliary header for the view submodule .
::ranges::iterator_t iterator_t
Alias for ranges::iterator_t. Obtains the iterator type of a range.
Definition: ranges:204
Adaptations of concepts from the Ranges TS.
::ranges::sentinel_t sentinel_t
Alias for ranges::sentinel_t. Obtains the sentinel type of a range.
Definition: ranges:199
::ranges::begin begin
Alias for ranges::begin. Returns an iterator to the beginning of a range.
Definition: ranges:174
The SeqAn3 namespace for views.
constexpr auto single_pass_input
A view adapter that decays most of the range properties and adds single pass behavior.
Definition: single_pass_input.hpp:381
Definition: aligned_sequence_concept.hpp:35
The std::Constructible concept specifies that a variable of type T can be initialized with the given ...
The OutputIterator concept is a refinement of std::Iterator, adding the requirement that it can be us...
::ranges::cend cend
Alias for ranges::cend. Returns an iterator to the end of a range.
Definition: ranges:214
The concept std::Same<T, U> is satisfied if and only if T and U denote the same type.
::ranges::end end
Alias for ranges::end. Returns an iterator to the end of a range.
Definition: ranges:179