15 #include <range/v3/algorithm/copy.hpp> 47 template <std::ranges::InputRange urng_t>
58 using reference = reference_t<urng_t>;
61 using const_reference = reference;
63 using value_type = value_type_t<urng_t>;
65 using size_type = detail::transformation_trait_or_t<seqan3::size_type<urng_t>,
void>;
67 using difference_type = difference_type_t<urng_t>;
71 using const_iterator = iterator;
77 view_persist() noexcept = default;
78 constexpr view_persist(view_persist const & rhs) noexcept = default;
79 constexpr view_persist(view_persist && rhs) noexcept = default;
80 constexpr view_persist & operator=(view_persist const & rhs) noexcept = default;
81 constexpr view_persist & operator=(view_persist && rhs) noexcept = default;
82 ~view_persist() noexcept = default;
87 view_persist(urng_t && _urange) :
88 urange{
new urng_t{std::move(_urange)}}
108 const_iterator
begin() const noexcept
114 const_iterator
cbegin() const noexcept
132 auto end() const noexcept
138 auto cend() const noexcept
147 template <
typename urng_t>
148 view_persist(urng_t &&) -> view_persist<std::remove_reference_t<urng_t>>;
157 class persist_fn :
public adaptor_base<persist_fn>
161 using base_t = adaptor_base<persist_fn>;
165 using base_t::base_t;
174 template <std::ranges::ViewableRange urng_t>
175 static auto impl(urng_t && urange)
183 template <std::ranges::Range urng_t>
184 static auto impl(urng_t && urange)
186 static_assert(!std::is_lvalue_reference_v<urng_t>,
"BUG: lvalue-reference in persist_fn::impl().");
187 return view_persist{std::move(urange)};
251 inline auto constexpr
persist = detail::persist_fn{};
::ranges::cbegin cbegin
Alias for ranges::cbegin. Returns an iterator to the beginning of a range.
Definition: ranges:209
Provides exceptions used in the I/O module.
Provides various shortcuts for common std::ranges functions.
constexpr auto all
A view adaptor that behaves like std::view:all, but type erases contiguous ranges.
Definition: view_all.hpp:160
::ranges::view_interface< urng_t > view_interface
Alias for ranges::view_interface.
Definition: ranges:220
Provides various transformation traits for use on iterators.
Additional non-standard concepts for ranges.
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::begin begin
Alias for ranges::begin. Returns an iterator to the beginning of a range.
Definition: ranges:174
The SeqAn3 namespace for views.
auto constexpr persist
A view adaptor that wraps rvalue references of non-views.
Definition: persist.hpp:251
Definition: aligned_sequence_concept.hpp:35
Adaptations of algorithms from the Ranges TS.
Provides various transformation traits used by the range module.
::ranges::cend cend
Alias for ranges::cend. Returns an iterator to the end of a range.
Definition: ranges:214
Adaptations of concepts from the standard library.
::ranges::end end
Alias for ranges::end. Returns an iterator to the end of a range.
Definition: ranges:179