[llvm] r361944 - [ADT] add iterator_range::empty()

Sam McCall via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 03:39:01 PDT 2019


Author: sammccall
Date: Wed May 29 03:39:01 2019
New Revision: 361944

URL: http://llvm.org/viewvc/llvm-project?rev=361944&view=rev
Log:
[ADT] add iterator_range::empty()

Modified:
    llvm/trunk/include/llvm/ADT/iterator_range.h

Modified: llvm/trunk/include/llvm/ADT/iterator_range.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/iterator_range.h?rev=361944&r1=361943&r2=361944&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/iterator_range.h (original)
+++ llvm/trunk/include/llvm/ADT/iterator_range.h Wed May 29 03:39:01 2019
@@ -44,6 +44,7 @@ public:
 
   IteratorT begin() const { return begin_iterator; }
   IteratorT end() const { return end_iterator; }
+  bool empty() const { return begin_iterator == end_iterator; }
 };
 
 /// Convenience function for iterating over sub-ranges.




More information about the llvm-commits mailing list