title: Using std::for_each on call a function with multiple arguments
body: <p>I did search, but the closest <a href="https://stackoverflow.com/questions/7393056/stdfor-each-usage-on-member-function-with-two-args">link</a> , among those found,  even doesn't match my problem.
  I have a <code>std::vector&lt;double&gt; mydata</code> array. I like to use <code>for_each</code> for that <code>mydata</code> array in calling a member function. That member function accepts two arguments. One is each element of <code>mydata</code> array and another one is a <code>int*</code> of another array. I do like</p>
  
  <pre><code>::std::for_each (mydata.begin(), mydata.end(), train(net));
  </code></pre>
  
  <p>That gives me a compilation error of <code>train</code> function does not take one argument. I know how to use for_each if there isn't <code>int*</code>.</p>
  
  <p>My train function is</p>
  
  <pre><code>void train(double const &amp; data, int* d){}
  </code></pre>
  
  <p>How can I make it work?
  Thanks</p>