72template <
typename out_t>
73auto const convert = std::views::transform(
74 [](
auto && in) -> out_t
76 static_assert(std::convertible_to<
decltype(in) &&, out_t> || std::constructible_from<out_t,
decltype(in) &&>,
77 "The reference type of the input to views::convert is not convertible to out_t.");
79 if constexpr (std::convertible_to<
decltype(in) &&, out_t>)
80 return std::forward<decltype(in)>(in);
82 return static_cast<out_t
>(std::forward<decltype(in)>(in));
Provides platform and dependency checks.
auto const convert
A view that converts each element in the input range (implicitly or via static_cast).
Definition: convert.hpp:73
The BioC++ namespace for views.