where container is any arbitrary standard container or an array.
Let assume that you have a two-dimensional array and you need to print the maximum element in every row of the array. You can use in this case two standard algorithms together.
1 2 3 4 5 6
int a[M][N];
...
std::for_each ( std::begin( a ), std::end( a ),
[] ( constint ( &x )[N] )
{ std::cout << *std::max_element( std::begin( x ), std::end( x ) )
<< std::endl; } );