49 template <std::ranges::range urng_t>
50 static constexpr auto impl(urng_t && urange)
53 std::ranges::viewable_range<urng_t>,
54 "The views::type_reduce adaptor can only be passed viewable_ranges, i.e. Views or &-to-non-View.");
62 else if constexpr (is_type_specialisation_of_v<std::remove_cvref_t<urng_t>,
std::basic_string>
63 && std::is_const_v<std::remove_reference_t<urng_t>>)
68 else if constexpr (std::ranges::borrowed_range<urng_t> && std::ranges::contiguous_range<urng_t>
69 && std::ranges::sized_range<urng_t>)
74 else if constexpr (std::ranges::borrowed_range<urng_t> && std::ranges::random_access_range<urng_t>
75 && std::ranges::sized_range<urng_t>)
77 return std::ranges::subrange<std::ranges::iterator_t<urng_t>, std::ranges::iterator_t<urng_t>>{
Provides seqan3::detail::adaptor_base and seqan3::detail::combined_adaptor.
CRTP-base to simplify the definition of range adaptor closure objects and similar types.
Definition: adaptor_base.hpp:77
View adaptor definition for views::type_reduce.
Definition: type_reduce.hpp:33
friend base_t
Befriend the base class so it can call impl().
Definition: type_reduce.hpp:44
static constexpr auto impl(urng_t &&urange)
Type erase if possible and delegate to std::views::all otherwise.
Definition: type_reduce.hpp:50
constexpr auto all
Returns a view that includes all elements of the range argument.
Definition: all_view.hpp:204
constexpr size_t size
The size of a type pack.
Definition: type_pack/traits.hpp:146
constexpr auto type_reduce
A view adaptor that behaves like std::views::all, but type erases certain ranges.
Definition: type_reduce.hpp:150
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
The SeqAn namespace for views.
Definition: char_strictly_to.hpp:22
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
decltype(views::type_reduce(std::declval< t >())) type_reduce_t
Deduces the return value of seqan3::views::type_reduce.
Definition: type_reduce.hpp:162
Provides type traits for working with templates.