Commit 7f2a1c90 authored by Alexander Theißen's avatar Alexander Theißen Committed by Wouter van Oortmerssen

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

parent f5387387
...@@ -441,6 +441,10 @@ protected: ...@@ -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: ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment