I did search, but the closest [link](https://stackoverflow.com/questions/7393056/stdfor-each-usage-on-member-function-with-two-args) , among those found, even doesn't match my problem.
I have a `std::vector<double> mydata` array. I like to use `for_each` for that `mydata` array in calling a member function. That member function accepts two arguments. One is each element of `mydata` array and another one is a `int*` of another array. I do like

```
::std::for_each (mydata.begin(), mydata.end(), train(net));

```

That gives me a compilation error of `train` function does not take one argument. I know how to use for\_each if there isn't `int*`.

My train function is

```
void train(double const & data, int* d){}

```

How can I make it work?
Thanks