26namespace bio::ranges::detail
44template <std::ranges::input_range urng_t>
45class view_persist :
public std::ranges::view_interface<view_persist<urng_t>>
55 view_persist() noexcept = default;
56 constexpr view_persist(view_persist const & rhs) noexcept = default;
57 constexpr view_persist(view_persist && rhs) noexcept = default;
58 constexpr view_persist & operator=(view_persist const & rhs) noexcept = default;
59 constexpr view_persist & operator=(view_persist && rhs) noexcept = default;
60 ~view_persist() noexcept = default;
65 view_persist(urng_t && _urange) : urange{
new urng_t{std::move(_urange)}} {}
87 auto begin() const noexcept
88 requires const_iterable_range<urng_t>
106 auto end() noexcept {
return std::ranges::end(*urange); }
109 auto end() const noexcept
110 requires const_iterable_range<urng_t>
112 return std::ranges::cend(*urange);
119template <
typename urng_t>
120view_persist(urng_t &&) -> view_persist<std::remove_reference_t<urng_t>>;
129class persist_fn :
public adaptor_base<persist_fn>
133 using base_t = adaptor_base<persist_fn>;
137 using base_t::base_t;
146 template <std::ranges::viewable_range urng_t>
147 static auto impl(urng_t && urange)
149 return std::views::all(std::forward<urng_t>(urange));
155 template <std::ranges::range urng_t>
156 static auto impl(urng_t && urange)
158 static_assert(!std::is_lvalue_reference_v<urng_t>,
"BUG: lvalue-reference in persist_fn::impl().");
159 return view_persist{std::forward<urng_t>(urange)};
220inline constexpr auto persist = detail::persist_fn{};
constexpr auto persist
A view adaptor that wraps rvalue references of non-views.
Definition: persist.hpp:220
The BioC++ namespace for views.
Additional non-standard concepts for ranges.
Adaptations of concepts from the standard library.
Auxiliary header for the views submodule .
Provides various transformation traits used by the range module.