<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 3, 2014 at 3:01 AM, Chris Lattner <span dir="ltr"><<a href="mailto:sabre@nondot.org" target="_blank">sabre@nondot.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="">On Mar 2, 2014, at 10:47 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>> wrote:<br>
<div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">
<div><div><div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I'm not aware of the prior art or standards are here, but I think that a global reverse() adapter is the way to go.  Likewise, we should have a standard "enumerate()" adaptor like python.</blockquote>



<div><br></div></div><div>I definitely prefer the global adaptor pattern.  As for prior art, I had played with it a bit, and came up with <a href="https://gist.github.com/compnerd/5694186" target="_blank">https://gist.github.com/compnerd/5694186</a> a while back.</div>


</blockquote></div><br>Yea, there is a pretty strong move toward range adaptors. If possible, I'm going to work on contributing a basic selection of them to LLVM's ADT specifically to address the immediate needs of range-based for loops.</div>


</div>
</blockquote></div><br></div></div><div>Sounds good.  We also have to decide what to do with Function::arg_begin() for example (and all the other secondary ranges hanging off IR and other things).  IMO, "for (auto &arg : F.getArguments())" makes the most sense.</div>

</div></blockquote><div><br></div><div>I was actually going to check in this, but I can post it for review if folks are worried.</div><div><br></div><div>My plan was to provide an implementation of std::iterator_range<T> and then provide 'F.arguments()' which returns it.</div>

</div></div></div></blockquote><br></div></div><div>Nice.  What's the logic behind .arguments() vs .getArguments()?  I don't have a strong opinion either way, but there should be rationale.</div></div></blockquote>
<div><br></div><div>My 2c is that we should choose a naming convention that yields a completely consistent way to mechanically transform foo_begin/foo_end to the range equivalent. Even just the plural has the usual natural language exceptions. My vote is for foo_begin/foo_end/foo_range.</div>
<div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="HOEnZb"><font color="#888888"><div>
<br></div><div>-Chris</div><br></font></span></div><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>