<div dir="ltr"><div class="gmail_extra">Since Richard first poked me about this, I'm still debating this.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I'm torn in a bunch of different ways:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">1) iterator_range is *not* a container. It shouldn't and can't be used like one.</div><div class="gmail_extra">2) members are really hard to extend. they make templates harder not easier because the widen the set of interfaces which *must* be on a given container</div>
<div class="gmail_extra">3) the concept of testing for emptiness is actually inherently useful for all ranges, unlike many other proposed extensions to the member interface, so maybe its OK to grow the interface in this direction</div>
<div class="gmail_extra">4) basing emptiness on iterators seems really bad because one of the important utilities of ranges is that they may expose concepts which are more flexible and efficient than a pair of iterators</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">However, one thing makes me inclined to say "no" to this: the benefit is miniscule. It is too simple to just compare the iterators and not cross any of these bridges today.</div>
<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 19, 2014 at 11:57 AM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":2i1" class="a3s" style="overflow:hidden"><div class="">> This is a pattern I ran into a handful of times when range-ifying<br>

> parts of clang (but not so frequently that I felt it was a major win),<br>
> so I'm roughly in favor of the API. However, if there's been<br>
> standardization efforts for range, we should be sure that we're doing<br>
> something compatible there.<br>
<br>
</div>There are a couple of proposals [1][2] that I can find.  It sounds like the<br>
exact set of methods to provide is somewhat contentious [3].  empty() seems<br>
pretty innocuous though.  Note that the standard proposals use std::range<br>
instead of std::iterator_range.<br>
<br>
In my opinion, other methods (e.g., front(), back(), and (for random access<br>
iterators) operator[]) would also be useful.</div></blockquote></div><br>I think front, back, and [] are extremely contentious. =] While empty may be the most innocuous, it also seems the least useful today.</div></div>