26template <
class TargetT,
typename SourceT>
27[[nodiscard]]
constexpr auto rangeTo(SourceT&& sourceRange)
29#if defined(__cpp_lib_ranges_to_container)
30 return std::ranges::to<TargetT>(std::forward<SourceT>(sourceRange));
32 using std::begin, std::end;
33 return TargetT(begin(sourceRange), end(sourceRange));
38template <
template <
typename>
class TargetT,
typename SourceT>
39[[nodiscard]]
constexpr auto rangeTo(SourceT&& sourceRange)
42#if defined(__cpp_lib_ranges_to_container)
43 return std::ranges::to<TargetT<std::ranges::range_value_t<SourceT>>>(
44 std::forward<SourceT>(sourceRange));
46 using std::begin, std::end;
47 return TargetT<std::ranges::range_value_t<SourceT>>(begin(sourceRange), end(sourceRange));
constexpr auto rangeTo(SourceT &&sourceRange)
A replacement of std::ranges::to() while toolchains catch up.