<div dir="ltr">We have many, many for loops still using iterators for this....<div><br></div><div>If you search for thinsg like `Foo &Var = *It++;` with different identifiers you will find a bunch.</div><div><br></div><div>I think we would be unsuccessful at converting them to lambda accepting algorithms. The range based for loop seems likely the most we would succeed in threading through how people think about this.... I mean, if there is no consensus for this iterator-like thing, then maybe we have to go w/ algorithms. My fear is that it means we will just go with iterator for loops.</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 30, 2018 at 7:31 PM David Blaikie via Phabricator via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dblaikie added a comment.<br>
<br>
Yeah, that's vaguely frightening as a thing (I mean, yeah, the assertions help catch misuse - but still).<br>
<br>
Got a pointer to an example of where you want to do this? Any chance of inverting this into a lambda-driven algorithm instead, maybe?<br>
<br>
  pre_inc_for(R, [&](const auto &V) {<br>
    ...<br>
  });<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D49956" rel="noreferrer" target="_blank">https://reviews.llvm.org/D49956</a><br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>