30 template <
typename view_t>
31 class single_pass_input_iterator;
38 template <std::ranges::view urng_t>
40 class single_pass_input_view :
public std::ranges::view_interface<single_pass_input_view<urng_t>>
46 using urng_iterator_type = std::ranges::iterator_t<urng_t>;
49 template <
typename view_t>
50 friend class single_pass_input_iterator;
58 urng_iterator_type cached_urng_iter = std::ranges::begin(urng);
68 using iterator = single_pass_input_iterator<single_pass_input_view>;
71 using const_iterator = void;
73 using sentinel = std::ranges::sentinel_t<urng_t>;
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) :
105 template <
typename other_urng_t>
108 std::ranges::viewable_range<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;
140 return {seqan3::end(state_ptr->urng)};
144 sentinel
end()
const =
delete;
147 sentinel
cend()
const =
delete;
156 template <std::ranges::viewable_range 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;
192 static_assert(std::sentinel_for<sentinel_type, base_iterator_type>);
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
264 if constexpr (std::output_iterator<base_iterator_type, reference> &&
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;
378 inline constexpr
auto single_pass_input = detail::adaptor_for_view_without_args<detail::single_pass_input_view>{};
Provides C++20 additions to the <iterator> header.
Provides various shortcuts for common std::ranges functions.
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:378
SeqAn specific customisations in the standard namespace.
The concept std::copy_constructible is satisfied if T is an lvalue reference type, or if it is a move_constructible object type where an object of that type can constructed from a (possibly const) lvalue or const rvalue of that type in both direct- and copy-initialization contexts with the usual semantics (a copy is constructed with the source unchanged).
detail::search_mode_all constexpr all
Configuration element to receive all hits within the error bounds.
Definition: mode.hpp:43
The SeqAn namespace for views.
Definition: view_to_simd.hpp:672
Provides various type traits.
Adaptations of concepts from the Ranges TS.
Definition: aligned_sequence_concept.hpp:36
The std::constructible_from concept specifies that a variable of type T can be initialized with the g...
auto const move
A view that turns lvalue-references into rvalue-references.
Definition: move.hpp:68
The concept std::same_as<T, U> is satisfied if and only if T and U denote the same type...
Auxiliary header for the views submodule .