add for_each c++ example.