Non-unit iterator stride with non-random access iterators
<p>With a random access iterator, you can change the stride length by simply doing iter+=n and then using &lt; container.end() instead of != container.end() as the loop ending condition:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;

int main(int argc, char *argv[])
{
  typedef std::vector&lt;float&gt; VectorType;
  typedef VectorType::const_iterator IteratorType;

  VectorType v;
  for(unsigned int i = 0; i &lt; 11; ++i)
  {
    v.push_back(i);
  }

  for(IteratorType iter = v.begin(); iter &lt; v.end(); iter += 2)
  {
    std::cout &lt;&lt; " " &lt;&lt; *iter;
  }

  return 0;
}
</code></pre>

<p>However both += 2 and &lt; iter.end() seem to be undefined for something like std::set. It seems reasonable to want traverse a set only visiting every other element (subsampling it), no? Is there another way to do this?</p>
