Fixed VS assignment constructor warning.
This commit is contained in:
parent
2f7f50b8cb
commit
f4a5c9de50
|
@ -1117,14 +1117,14 @@ FLATBUFFERS_FINAL_CLASS
|
||||||
bool force_defaults_; // Serialize values equal to their defaults anyway.
|
bool force_defaults_; // Serialize values equal to their defaults anyway.
|
||||||
|
|
||||||
struct StringOffsetCompare {
|
struct StringOffsetCompare {
|
||||||
StringOffsetCompare(const vector_downward &buf) : buf_(buf) {}
|
StringOffsetCompare(const vector_downward &buf) : buf_(&buf) {}
|
||||||
bool operator() (const Offset<String> &a, const Offset<String> &b) const {
|
bool operator() (const Offset<String> &a, const Offset<String> &b) const {
|
||||||
auto stra = reinterpret_cast<const String *>(buf_.data_at(a.o));
|
auto stra = reinterpret_cast<const String *>(buf_->data_at(a.o));
|
||||||
auto strb = reinterpret_cast<const String *>(buf_.data_at(b.o));
|
auto strb = reinterpret_cast<const String *>(buf_->data_at(b.o));
|
||||||
return strncmp(stra->c_str(), strb->c_str(),
|
return strncmp(stra->c_str(), strb->c_str(),
|
||||||
std::min(stra->size(), strb->size()) + 1) < 0;
|
std::min(stra->size(), strb->size()) + 1) < 0;
|
||||||
}
|
}
|
||||||
const vector_downward &buf_;
|
const vector_downward *buf_;
|
||||||
};
|
};
|
||||||
|
|
||||||
// For use with CreateSharedString. Instantiated on first use only.
|
// For use with CreateSharedString. Instantiated on first use only.
|
||||||
|
|
Loading…
Reference in New Issue