Implement new SmallVector::data() methods.
authorJay Foad <jay.foad@gmail.com>
Thu, 21 May 2009 09:00:37 +0000 (09:00 +0000)
committerJay Foad <jay.foad@gmail.com>
Thu, 21 May 2009 09:00:37 +0000 (09:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72209 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/SmallVector.h

index bf4960ad1445a6e6c3093bfb06824d0ff4f94442..de5648fe8527074bcd5b2e0da5cdfcc227da0787 100644 (file)
@@ -374,6 +374,16 @@ public:
     return I;
   }
 
+  /// data - Return a pointer to the vector's buffer, even if empty().
+  pointer data() {
+    return pointer(Begin);
+  }
+
+  /// data - Return a pointer to the vector's buffer, even if empty().
+  const_pointer data() const {
+    return const_pointer(Begin);
+  }
+
   const SmallVectorImpl &operator=(const SmallVectorImpl &RHS);
 
   bool operator==(const SmallVectorImpl &RHS) const {