Prevent flatbuffers::Vector and flatbuffers::VectorOfAny to be copied (#4217)

This commit is contained in:
Alexander Theißen
2017-03-13 16:53:30 +01:00
committed by Wouter van Oortmerssen
parent f5387387de
commit 7f2a1c90d5

View File

@@ -441,6 +441,10 @@ protected:
uoffset_t length_;
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) {
const K *key = reinterpret_cast<const K *>(ap);
const uint8_t *data = reinterpret_cast<const uint8_t *>(bp);
@@ -468,6 +472,9 @@ protected:
VectorOfAny();
uoffset_t length_;
private:
VectorOfAny(const VectorOfAny&);
};
// Convenient helper function to get the length of any vector, regardless