<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On Mar 4, 2014, at 3:38 PM, Sean Silva <<a href="mailto:silvas@purdue.edu">silvas@purdue.edu</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 class=""><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; position: static; z-index: auto;">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.<br></blockquote>
<div><br></div><div>`enumerate` is going to be so much more annoying to use without tuple unpacking in the `for` syntax :(</div></div></div></div></blockquote><br></div></div><div>Sure, it won't be as nice as Python, but in my limited experience with C++'11 foreach loops, the #1 reason I can't use them is because there is no way to parallel iterate two vectors (as a random example) which would be simple if an index were available. It doesn't matter to me how syntactically convenient it is to get the index, so long as it is possible.</div>
</div></blockquote><div><br></div><div> Iterating two vectors in parallel also suggests a variadic `auto zip(...) -> std::tuple<...>` helper.</div></div></div></div></blockquote><br></div><div>Right, but that is simply *one* example where enumerate would be useful. There are lots of other ones.</div><div><br></div><div>-Chris</div><br></body></html>