blob: 872b73e6fd971732c022d4db69c4bc9f40a6fb95 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h
index c4dc5bc..c090455 100644
--- a/include/flatbuffers/flatbuffers.h
+++ b/include/flatbuffers/flatbuffers.h
@@ -1861,14 +1861,14 @@ class FlatBufferBuilder {
/// @cond FLATBUFFERS_INTERNAL
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 {
- auto table_a = reinterpret_cast<T *>(buf_.data_at(a.o));
- auto table_b = reinterpret_cast<T *>(buf_.data_at(b.o));
+ auto table_a = reinterpret_cast<T *>(buf_->data_at(a.o));
+ auto table_b = reinterpret_cast<T *>(buf_->data_at(b.o));
return table_a->KeyCompareLessThan(table_b);
}
- vector_downward &buf_;
+ vector_downward *buf_;
private:
TableKeyComparator &operator=(const TableKeyComparator &other) {
|