title: Using auto (for iterating) in nested range-based for loop
body: <p>Currently I have started using <code>auto</code> keyword.I have some doubt regarding that:</p>
  
  <p>If I need to traverse the <code>vector</code> I do :</p>
  
  <pre><code>vector&lt;int&gt;v; 
  
  for(auto it : v){    
  
     cout &lt;&lt; it &lt;&lt;endl; 
  
  }
  </code></pre>
  
  <p>But suppose if I need to do something like:</p>
  
  <pre><code>vector&lt;int&gt;v;
  
  for(auto it:v){    
     for(auto jt:X){
  
     //where X is next position of it's position
     //What I mean is if it is currently at 2nd position then 
     //jt iterator will start from 3rd position
  
     }    
  }
  </code></pre>
  
  <p>I have absolutely no idea how to do that.Please Suggest what is the appropriate method for that.Thanks in advance.</p>