[llvm] [ADT] Introduce a `static_cast_to` (PR #165803)
Jakub Kuderski via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 31 03:28:54 PDT 2025
================
@@ -1704,6 +1704,11 @@ auto sum_of(R &&Range, E Init = E{0}) {
return accumulate(std::forward<R>(Range), std::move(Init));
}
+/// Return a range where each value of `R` is static_cast to `T`
+template <typename T, typename R> auto static_cast_to(R &&Range) {
----------------
kuhar wrote:
`map_range(Foo, StaticCastF<unsigned>)
https://github.com/llvm/llvm-project/pull/165803
More information about the llvm-commits
mailing list