blob: 28c4d34cb2b63909c8272de662ab1fb3500b4e10 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
'vector_downward &operator=(vector_downward &&other)' wants an rvalue.
other.buf_ is a lvalue.
Newer clang compilers are stricter about this.
clang++19 and later complain:
include/flatbuffers/flatbuffers.h:1866:12: error: overload resolution selected deleted operator '='
1866 | buf_ = other.buf_;
| ~~~~ ^ ~~~~~~~~~~
For this py-tflite-support port, if you comment out TableKeyComparator &operator=(),
it builds.
Another fix is to convert the lvalue to an rvalue using std::move()
which is not an expensive operation. That also builds with older
or newe clang++.
--- include/flatbuffers/flatbuffers.h.orig 2020-03-20 02:52:36 UTC
+++ include/flatbuffers/flatbuffers.h
@@ -1862,10 +1862,12 @@ class FlatBufferBuilder {
vector_downward &buf_;
private:
+#if 1
TableKeyComparator &operator=(const TableKeyComparator &other) {
- buf_ = other.buf_;
+ buf_ = std::move(other.buf_);
return *this;
}
+#endif
};
/// @endcond
|