aboutsummaryrefslogtreecommitdiff
path: root/src/prevector.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2016-09-30 17:19:51 +0200
committerWladimir J. van der Laan <[email protected]>2016-09-30 17:19:51 +0200
commit47314e6daad8157c9e36af90a47b3ae7fa0587de (patch)
treef5b6f0392096212c6d1182b2a7b56614a5f1176a /src/prevector.h
parentMerge #8822: net: Consistent checksum handling (diff)
downloaddiscoin-47314e6daad8157c9e36af90a47b3ae7fa0587de.tar.xz
discoin-47314e6daad8157c9e36af90a47b3ae7fa0587de.zip
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 a0e1e140b..d840dfcd0 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)