From: Rafael Espindola Date: Tue, 11 Aug 2015 16:12:56 +0000 (+0000) Subject: Add non-member begin and end so that drop_begin works on iterator_range. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a09a71fcea3d5cf2e2b3a697ff08c3703fcc576a;p=oota-llvm.git Add non-member begin and end so that drop_begin works on iterator_range. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244620 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/iterator_range.h b/include/llvm/ADT/iterator_range.h index 3dd679bd9b7..9ab1c9645b3 100644 --- a/include/llvm/ADT/iterator_range.h +++ b/include/llvm/ADT/iterator_range.h @@ -47,6 +47,16 @@ public: IteratorT end() const { return end_iterator; } }; +template +IteratorT begin(const iterator_range &R) { + return R.begin(); +} + +template +IteratorT end(const iterator_range &R) { + return R.end(); +} + /// \brief Convenience function for iterating over sub-ranges. /// /// This provides a bit of syntactic sugar to make using sub-ranges