diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-09-30 17:19:51 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-09-30 17:19:51 +0200 |
| commit | 47314e6daad8157c9e36af90a47b3ae7fa0587de (patch) | |
| tree | f5b6f0392096212c6d1182b2a7b56614a5f1176a /src/prevector.h | |
| parent | Merge #8822: net: Consistent checksum handling (diff) | |
| download | discoin-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.h | 8 |
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) |