<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 3, 2015 at 10:54 AM, GerdH <span dir="ltr"><<a href="mailto:gerd.hoeren@autodesk.com" target="_blank">gerd.hoeren@autodesk.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">But, the same loop with a const_iterator doesn’t get converted.  I’d expect:<br>
    for (std::vector<int>::const_iterator iter = my_container.begin(); iter<br>
!= my_container.end(); ++iter) {<br>
        i = *iter;<br>
    }<br>
To transform into:<br>
    for (const auto & elem : my_container) {<br>
        i = elem;<br>
    }<br>
<br>
Is this a reasonable transformation?<br>
<br>
Is it a bug or enhancement request?</blockquote><div><br></div><div>Hmm, I don't have a direct answer for you, but the transformation there does technically imply the loop changing from using const_iterator behind the scenes to using iterator behind the scenes, so this might be intentional. It depends on where the line is drawn regarding what is considered to be only a minor change of behavior.</div></div><div><br></div>-- <br><div class="gmail_signature">-Matt Calabrese</div>
</div></div>