Index: llvm/include/llvm/ADT/iterator_range.h =================================================================== --- llvm/include/llvm/ADT/iterator_range.h +++ llvm/include/llvm/ADT/iterator_range.h @@ -29,7 +29,12 @@ /// fancy at all. template class iterator_range { - IteratorT begin_iterator, end_iterator; +public: + using iterator = IteratorT; + using const_iterator = IteratorT; + +private: + iterator begin_iterator, end_iterator; public: //TODO: Add SFINAE to test that the Container's iterators match the range's @@ -38,12 +43,12 @@ iterator_range(Container &&c) //TODO: Consider ADL/non-member begin/end calls. : begin_iterator(c.begin()), end_iterator(c.end()) {} - iterator_range(IteratorT begin_iterator, IteratorT end_iterator) + iterator_range(iterator begin_iterator, iterator end_iterator) : begin_iterator(std::move(begin_iterator)), end_iterator(std::move(end_iterator)) {} - IteratorT begin() const { return begin_iterator; } - IteratorT end() const { return end_iterator; } + iterator begin() const { return begin_iterator; } + iterator end() const { return end_iterator; } }; /// Convenience function for iterating over sub-ranges.