mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-30 22:41:38 +00:00
Prevent flatbuffers::Vector and flatbuffers::VectorOfAny to be copied (#4217)
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
f5387387de
commit
7f2a1c90d5
@@ -441,6 +441,10 @@ protected:
|
|||||||
uoffset_t length_;
|
uoffset_t length_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// This class is a pointer. Copying will therefore create an invalid object.
|
||||||
|
// Private and unimplemented copy constructor.
|
||||||
|
Vector(const Vector&);
|
||||||
|
|
||||||
template<typename K> static int KeyCompare(const void *ap, const void *bp) {
|
template<typename K> static int KeyCompare(const void *ap, const void *bp) {
|
||||||
const K *key = reinterpret_cast<const K *>(ap);
|
const K *key = reinterpret_cast<const K *>(ap);
|
||||||
const uint8_t *data = reinterpret_cast<const uint8_t *>(bp);
|
const uint8_t *data = reinterpret_cast<const uint8_t *>(bp);
|
||||||
@@ -468,6 +472,9 @@ protected:
|
|||||||
VectorOfAny();
|
VectorOfAny();
|
||||||
|
|
||||||
uoffset_t length_;
|
uoffset_t length_;
|
||||||
|
|
||||||
|
private:
|
||||||
|
VectorOfAny(const VectorOfAny&);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Convenient helper function to get the length of any vector, regardless
|
// Convenient helper function to get the length of any vector, regardless
|
||||||
|
|||||||
Reference in New Issue
Block a user