iterator_range was originally modeled on a proposed std::iterator_range, I never found those papers but boost's iterator_range publicly exposes these types.
Details
Diff Detail
Event Timeline
Just to note: there's a typo in your summary (cosnt_iterator -> const_iterator).
What's the context for this? Why do you need these iterator types defined rather than just using whatever was passed in? (I think I know the answer, but I just want you to explain for people reading this in the future).
Defining iterator and const_iterator allows it to be used specifically for my use case in D64462 but also in other types I'm sure. Notably many function templates in iterator will not work, std::begin and std::end need one of these types to be publicly defined for example, but one would expect these function templates to work with llvm::iterator_range.
Okay, I think this LGTM, but only put this in if this is actually needed in any final version of D64462.
llvm/include/llvm/ADT/iterator_range.h | ||
---|---|---|
39 | You can insert using iterator = IteratorT; using const_iterator = IteratorT; here to avoid adding two access modifiers. |
You can insert
here to avoid adding two access modifiers.