aboutsummaryrefslogtreecommitdiff
path: root/src/prevector.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-09-30 17:19:51 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-09-30 17:19:51 +0200
commit47314e6daad8157c9e36af90a47b3ae7fa0587de (patch)
treef5b6f0392096212c6d1182b2a7b56614a5f1176a /src/prevector.h
parent9bc6a6bd7b0ddb12cbafdd6d3b70fb6b10c0d2ba (diff)
prevector: add C++11-like data() method
This returns a pointer to the beginning of the vector's data.
Diffstat (limited to 'src/prevector.h')
-rw-r--r--src/prevector.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/prevector.h b/src/prevector.h
index a0e1e140b4..d840dfcd08 100644
--- a/src/prevector.h
+++ b/src/prevector.h
@@ -475,6 +475,14 @@ public:
return ((size_t)(sizeof(T))) * _union.capacity;
}
}
+
+ value_type* data() noexcept {
+ return item_ptr(0);
+ }
+
+ const value_type* data() const {
+ return item_ptr(0);
+ }
};
#pragma pack(pop)