The std::transform algorithm can copy elements from one range to another, applying a transformation to each element. The transformation can change the type of the range.
The algorithm also provides a binary variant which can be used to reduce two ranges into one.
Both variants offer C++17 parallel and C++20 range versions.
Compiler Explorer link: https://compiler-explorer.com/z/9E8fq6EP3