Fixed VS assignment constructor warning.

This commit is contained in:
Wouter van Oortmerssen 2016-04-04 13:00:48 -07:00
parent 2f7f50b8cb
commit f4a5c9de50
1 changed files with 4 additions and 4 deletions

View File

@ -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.