C++ Standard Library for_each() Sample

Description

for_each() iterates over elements in a sequence, calling a function for each element. It can be used to eliminate explicit loops.

Declaration

	template <class In, class Op>
	    Op for_each(In, In, Op);

Concept

The example uses for_each() to iterate over a vector of integers. The function f() is called for each element in turn, resulting in the output of the element value.

Supported
Supported
Supported