int p(int i, int j)
{
std::cout << i+j << std::endl;
return 0;
}
int main(int argc, char **argv)
{
std::vector<int> vi;
vi.push_back(10);
vi.push_back(20);
vi.push_back(30);
vi.push_back(40);
vi.push_back(50);
std::for_each(vi.begin(), vi.end(), [](int n) { std::cout << n << std::endl; });
std::for_each(vi.begin(), vi.end(), std::bind2nd(std::ptr_fun(p), 300));
//std::for_each(vi.begin(), vi.end(), std::bind2nd(std::mem_fun([](int n, int m) { std::cout << n+m << " "; }),
300)); err
}