[Clang 10]: definition of implicit copy constructor for 'TableKeyComparatoris deprecated #5649 (#5650)

This commit is contained in:
Ivan Shynkarenka 2019-12-03 01:10:09 +03:00 committed by Wouter van Oortmerssen
parent 58e279244c
commit 75823cc275
1 changed files with 5 additions and 1 deletions

View File

@ -1837,6 +1837,7 @@ class FlatBufferBuilder {
/// @cond FLATBUFFERS_INTERNAL /// @cond FLATBUFFERS_INTERNAL
template<typename T> struct TableKeyComparator { template<typename T> struct TableKeyComparator {
TableKeyComparator(vector_downward &buf) : buf_(buf) {} TableKeyComparator(vector_downward &buf) : buf_(buf) {}
TableKeyComparator(const TableKeyComparator &other) : buf_(other.buf_) {}
bool operator()(const Offset<T> &a, const Offset<T> &b) const { bool operator()(const Offset<T> &a, const Offset<T> &b) const {
auto table_a = reinterpret_cast<T *>(buf_.data_at(a.o)); auto table_a = reinterpret_cast<T *>(buf_.data_at(a.o));
auto table_b = reinterpret_cast<T *>(buf_.data_at(b.o)); auto table_b = reinterpret_cast<T *>(buf_.data_at(b.o));
@ -1845,7 +1846,10 @@ class FlatBufferBuilder {
vector_downward &buf_; vector_downward &buf_;
private: private:
TableKeyComparator &operator=(const TableKeyComparator &); TableKeyComparator &operator=(const TableKeyComparator &other) {
buf_ = other.buf_;
return *this;
}
}; };
/// @endcond /// @endcond