title: How to find the index of current object in range-based for loop?
body: <p>Assume I have the following code:</p>
  
  <pre><code>vector&lt;int&gt; list;
  for(auto&amp; elem:list) {
      int i = elem;
  }
  </code></pre>
  
  <p>Can I find the position of <code>elem</code> in the vector without maintaining a separate iterator?</p>