Add move constructor for FlatbufferVector
This optimizes the log file reader by a little bit. It was copying.
Change-Id: Ia9df340208481d85e19ce96183c4b181d8a0e100
diff --git a/aos/flatbuffers.h b/aos/flatbuffers.h
index 1050417..630741f 100644
--- a/aos/flatbuffers.h
+++ b/aos/flatbuffers.h
@@ -162,6 +162,9 @@
FlatbufferVector(const Flatbuffer<T> &other)
: data_(other.data(), other.data() + other.size()) {}
+ // Move constructor.
+ FlatbufferVector(Flatbuffer<T> &&other) : data_(std::move(other.data())) {}
+
// Copies the data from the other flatbuffer.
FlatbufferVector &operator=(const Flatbuffer<T> &other) {
data_ = std::vector<uint8_t>(other.data(), other.data() + other.size());