title: C++14 Make custom iterator, that will go by 2 and returns modified data
body: <p>I have class <code>Range</code> which holds a interval like <code>&lt;2,10&gt;</code> or <code>&lt;-50,900&gt;</code>
  and than I have <code>RangeList</code> and I want to have <code>vector&lt;long long&gt;</code> which represents multiple ranges. I don't need to have <code>vector&lt;Range&gt;</code> for some purpose. </p>
  
  <p>But i want to make iterator that will go through <code>ranges</code> and it will retrun Range. Is it possible to define custom iterator that will work like that?</p>
  
  <pre><code>   class Range {
          long long lo;
          long long hi;
      }
  
      class RangeList {
      vector&lt;long long&gt; ranges;
  
      }
  </code></pre>
  
  <p>example</p>
  
  <pre><code>ranges={1, 50, 200, 700, 900, 1000};
  </code></pre>
  
  <p>so iterator will go through and it would return</p>
  
  <p>first iteration</p>
  
  <pre><code>Range &lt;1,50&gt;
  </code></pre>
  
  <p>secondi teration</p>
  
  <pre><code>Range &lt;200,700&gt;
  </code></pre>
  
  <p>third teration</p>
  
  <pre><code>Range &lt;900,100&gt;
  </code></pre>
  
  <p><strong>Thanks for any advice</strong></p>