<div dir="ltr"><div>I'm taking inspiration from those:</div><div><br></div><a href="http://www.boost.org/doc/libs/1_53_0/libs/range/doc/html/range/reference/utilities/iterator_range.html" target="_blank">http://www.boost.org/doc/libs/<wbr>1_53_0/libs/range/doc/html/<wbr>range/reference/utilities/<wbr>iterator_range.html</a><br><div><br></div><div>To me, "slice" would cut the range (intuitively). But I'm not an English native.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 12, 2017 at 10:33 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'd prefer not to add these to iterator_range itself, but as free functions so they work on any range, including arrays, etc.<br><br>the advance_* ones, (is that the canonical/common name for those? I'd have guessed 'slice') could be free functions over arbitrary ranges that return iterator ranges, perhaps (though that gets into tricky territory, admittedly - lifetime expectations, views versus concrete/value ranges, etc)</div><br><div class="gmail_quote"><div><div class="m_6733368646769714868h5"><div dir="ltr">On Mon, Dec 11, 2017 at 4:30 PM Alexandre Isoard via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_6733368646769714868h5"><div dir="ltr">Hello,<div><br></div><div>Our llvm::iterator_range is quite minimalist in design, it does not even have an "empty" method.</div><div>Is that because we want it to work on all iterators (including those dirty OutputIterator)?</div><div><br></div><div>Maybe we can add a little bit to it?</div><div><br></div><div>I recently needed:<br>- bool empty()<br>- value_type& font()<br>- value_type& back()<br>- void advance_begin(difference_type n)<br>- void advance_end(difference_type n)</div><div><br></div><div>Would you be open to those?<br clear="all"><div><br></div>-- <br><div class="m_6733368646769714868m_8498595003852985199m_-1022166958182785713gmail_signature"><div dir="ltr"><b>Alexandre Isoard</b><br></div></div>
</div></div></div></div>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_6733368646769714868gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b>Alexandre Isoard</b><br></div></div>
</div></div>