<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 10, 2015 at 5:43 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@gmail.com" target="_blank">chandlerc@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 id=":fjz" class="a3s" style="overflow:hidden">Author: chandlerc<br>
Date: Sat Jan 10 19:43:06 2015<br>
New Revision: 225594<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=225594&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=225594&view=rev</a><br>
Log:<br>
Don't rely on the default constructor default constructing a begin and<br>
end iterator for iterator_range<>. I removed this constructor because<br>
for some iterators (notably pointers) it left begin and end<br>
uninitialized. It also is an usual constraint that an iterator default<br>
constructs to a valid end iterator such that the pair of them for<br>
a valid range. In the three places where this was used in Clang,<br>
explicitly build the empty range from the iterators and comment on why<br>
default constructed iterators make sense here.</div></blockquote></div><br>FYI, I've raised the possibility of making iterator_range<T> require T to be a forward iterator (or at least require the default constructor and the fact that default constructed iterators behave as if one-past-the-end of an empty range), or of detecting this property on the LLVM commit where I removed the default constructor for iterator_range... Currently, I'm unconvinced the complexity it adds to iterator_range is worth it for the 3 places in all of LLVM and Clang (and LLD and ...) where I've found code that used it...</div></div>