Convenience wrapper to make dealing with sub-ranges easier. Like the
iterator_range<> itself, if/when this sort of thing gets standards
blessing, it will be replaced by the official version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205987
91177308-0d34-0410-b5e6-
96231b3b80d8
IteratorT begin() const { return begin_iterator; }
IteratorT end() const { return end_iterator; }
};
+
+/// \brief Convenience function for iterating over sub-ranges.
+///
+/// This provides a bit of syntactic sugar to make using sub-ranges
+/// in for loops a bit easier. Analogous to std::make_pair().
+template<class T> iterator_range<T> make_range(const T &x, const T &y) {
+ return (iterator_range<T>(x, y));
+}
}
#endif