From f4a5c9de5094173a214e2f34d1db9d7e57fcb840 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Mon, 4 Apr 2016 13:00:48 -0700 Subject: [PATCH] Fixed VS assignment constructor warning. --- include/flatbuffers/flatbuffers.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index e08e96118..2c3398bd2 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -1117,14 +1117,14 @@ FLATBUFFERS_FINAL_CLASS bool force_defaults_; // Serialize values equal to their defaults anyway. struct StringOffsetCompare { - StringOffsetCompare(const vector_downward &buf) : buf_(buf) {} + StringOffsetCompare(const vector_downward &buf) : buf_(&buf) {} bool operator() (const Offset &a, const Offset &b) const { - auto stra = reinterpret_cast(buf_.data_at(a.o)); - auto strb = reinterpret_cast(buf_.data_at(b.o)); + auto stra = reinterpret_cast(buf_->data_at(a.o)); + auto strb = reinterpret_cast(buf_->data_at(b.o)); return strncmp(stra->c_str(), strb->c_str(), 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.