stl study using the function and for_each