diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 0fa31250f..ef4a693cc 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -333,7 +333,7 @@ public: // Change elements if you have a non-const pointer to this object. // Scalars only. See reflection.h, and the documentation. - void Mutate(uoffset_t i, T val) { + void Mutate(uoffset_t i, const T& val) { assert(i < size()); WriteScalar(data() + i, val); }