20namespace seqan3::detail
29class type_reduce_fn :
public adaptor_base<type_reduce_fn>
33 using base_t = adaptor_base<type_reduce_fn>;
46 template <std::ranges::range urng_t>
47 static constexpr auto impl(urng_t && urange)
50 std::ranges::viewable_range<urng_t>,
51 "The views::type_reduce adaptor can only be passed viewable_ranges, i.e. Views or &-to-non-View.");
56 return std::views::all(std::forward<urng_t>(urange));
59 else if constexpr (is_type_specialisation_of_v<std::remove_cvref_t<urng_t>,
std::basic_string>
60 && std::is_const_v<std::remove_reference_t<urng_t>>)
65 else if constexpr (std::ranges::borrowed_range<urng_t> && std::ranges::contiguous_range<urng_t>
66 && std::ranges::sized_range<urng_t>)
68 return std::span{std::ranges::data(urange), std::ranges::size(urange)};
71 else if constexpr (std::ranges::borrowed_range<urng_t> && std::ranges::random_access_range<urng_t>
72 && std::ranges::sized_range<urng_t>)
74 return std::ranges::subrange<std::ranges::iterator_t<urng_t>, std::ranges::iterator_t<urng_t>>{
77 std::ranges::size(urange)};
82 return std::views::all(std::forward<urng_t>(urange));
147inline constexpr auto type_reduce = detail::type_reduce_fn{};
159using type_reduce_t =
decltype(views::type_reduce(std::declval<t>()));
Provides seqan3::detail::adaptor_base and seqan3::detail::combined_adaptor.
The SeqAn namespace for views.
Definition char_strictly_to.hpp:19
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
Provides type traits for working with templates.