Skip to content

Commit c3ecc12

Browse files
committed
prevector: add C++11-like data() method
This returns a pointer to the beginning of the vector's data. backports bitcoin/bitcoin@47314e6
1 parent 5490aa0 commit c3ecc12

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/prevector.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,14 @@ class prevector {
475475
return ((size_t)(sizeof(T))) * _union.capacity;
476476
}
477477
}
478+
479+
value_type* data() noexcept {
480+
return item_ptr(0);
481+
}
482+
483+
const value_type* data() const {
484+
return item_ptr(0);
485+
}
478486
};
479487
#pragma pack(pop)
480488

0 commit comments

Comments
 (0)