43template <std::ranges::input_range urng_t>
44class view_persist :
public std::ranges::view_interface<view_persist<urng_t>>
65 urange{
new urng_t{std::move(_urange)}}
87 return std::ranges::begin(*
urange);
96 return std::ranges::cbegin(*
urange);
114 return std::ranges::end(*
urange);
123 return std::ranges::cend(*
urange);
130template <
typename urng_t>
149 using base_t::base_t;
158 template <std::ranges::viewable_range urng_t>
159 static auto impl(urng_t && urange)
161 return std::views::all(std::forward<urng_t>(urange));
167 template <std::ranges::range urng_t>
168 static auto impl(urng_t && urange)
170 static_assert(!std::is_lvalue_reference_v<urng_t>,
"BUG: lvalue-reference in persist_fn::impl().");
Provides seqan3::detail::adaptor_base and seqan3::detail::combined_adaptor.
The <algorithm> header from C++20's standard library.
CRTP-base to simplify the definition of range adaptor closure objects and similar types.
Definition: adaptor_base.hpp:77
[adaptor_def]
Definition: persist_view.hpp:142
friend base_t
Befriend the base class so it can call impl().
Definition: persist_view.hpp:153
static auto impl(urng_t &&urange)
For ranges that are viewable, delegate to std::views::all.
Definition: persist_view.hpp:159
The type returned by seqan3::detail::persist.
Definition: persist_view.hpp:45
auto end() noexcept
Returns an iterator to the element following the last element of the range.
Definition: persist_view.hpp:112
view_persist(urng_t &&) -> view_persist< std::remove_reference_t< urng_t > >
Template argument type deduction guide that strips references.
auto end() const noexcept
Returns an iterator to the element following the last element of the range.
Definition: persist_view.hpp:118
auto begin() const noexcept
Returns an iterator to the first element of the container.
Definition: persist_view.hpp:91
std::shared_ptr< urng_t > urange
Shared storage of the underlying range.
Definition: persist_view.hpp:48
auto begin() noexcept
Returns an iterator to the first element of the container.
Definition: persist_view.hpp:85
view_persist() noexcept=default
Defaulted.
The <concepts> header from C++20's standard library.
Provides various transformation traits used by the range module.
auto constexpr persist
[adaptor_def]
Definition: persist_view.hpp:223
Specifies requirements of an input range type for which the const version of that type satisfies the ...
Provides various transformation traits for use on iterators.
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
The <ranges> header from C++20's standard library.
Additional non-standard concepts for ranges.