Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C++ Language/Std/Stl/Algorithms/ApplyingItemByItem/ProcessingItemByItem

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

If you have a function like void DoubleEach(int& x) { x *= 2; }, then you can repeatedly apply that same callable-object, once per collection item. The algorithm to do so is std::for_each(v.begin(), v.end(), DoubleEach). Additional information about item-by-item processing (includes interactive examples)