Applying Several Transforms in One Pass on a Collection
▻https://www.fluentcpp.com/2019/02/22/applying-several-transforms-in-one-pass-on-a-collection
Applying a function to each element of a collection and outputting the results into another collection is a very common thing to do, in C++ or elsewhere. In C++, we have the std::transform algorithm to do this, a central piece of the STL algorithms library. To illustrate, consider the following program: [crayon-5c6f49be6af1d905388700/] It outputs this: […]