C++ Language/Std/Stl/Algorithms/ApplyingItemByItem/IgnoringPriorValues
Appearance
Unlike the DoubleEach()
example, this function ignores existing item-values: int Compute99() { return 99; }
.
The algorithm to use it is std::generate(v.begin(), v.end(), Compute99)
.