<div dir="ltr">Passing begin and end is consistent with STL, so the original interface made sense. I don't think adding `const` improves the code because it doesn't make it consistent with STL and, even worse, it makes the code inconsistent with the LLVM libraries.<div><br></div><div>My point is that, if you can keep code simple by writing a few more lines of code, it is worth doing, and removing a few lines of code by depending on a subtle behavior is not usually worth it. (So, in that sense, asking whether adding const improves the code or not is irrelevant, as we don't want to even think about it unless we have to think about it.)</div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 4, 2017 at 7:01 PM, George Rimar <span dir="ltr"><<a href="mailto:grimar@accesssoftek.com" target="_blank">grimar@accesssoftek.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>>ruiu added a comment.<br>
><br>
>I wouldn't request you revert this, but if I were you, I wouldn't have commit this change, because as we discussed, this change contains subtle code that seems only language >experts can understand. I don't think it is overall beneficial to save a few lines of code by writing very "smart" code here.<br>
<br>
</span>We still can save few lines if use "const R& Range" instead of "R &&Range". It would work for LLD.<br>
I would be fine with const version too, because personally for me ranged<br>
vesrions of algorithms is much easier to read as I do not need to read where is the begin() and where is end().<br>
<br>
So If you prefer 'const' I can change it in that way. I think in this discussion was already that we can use<br>
any way in LLD and change to && version later if we will need it, looks nobody be against using 'const' atm.<br>
<br>
Though "R &&Range" is still consistent with the rest LLVM code.<br>
<span class="gmail-m_-3097332579674325053m_4750143529610639941HOEnZb"><font color="#888888"><br>
George.</font></span></blockquote></div><br></div></div></div>