title: Using a lambda with std::advance along with std::for_each()
body: <p>I need to use std::for_each() to iterate through a list. However, in the UnaryFunction part of for_each(), I need to use a lambda which actually advances the iterator by means of std::advance(). </p>
  
  <p>For instance</p>
  
  <pre><code>for_each(beginIter, endIter, lambda);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>auto lambda [] = (&lt;Iter parameter&gt;){advance(Iter parameter, 1)};
  </code></pre>
  
  <p>I am expecting that when the lambda returns, the for_each() would resume iterating from the position where the lambda left off.</p>
  
  <p>Is this understanding correct?</p>
  
  <p>TIA</p>
  
  <p>Vinod</p>