We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ab4b74 commit 3afaa72Copy full SHA for 3afaa72
include/msgpack23/msgpack23.h
@@ -151,7 +151,7 @@ namespace msgpack23 {
151
152
template<std::integral T>
153
void emplace_combined(FormatConstants const &constant, T const &value) {
154
- data_.reserve(1 + sizeof(T));
+ data_.reserve(data_.size() + 1 + sizeof(T));
155
emplace_constant(constant);
156
emplace_integral<T>(value);
157
}
@@ -245,6 +245,7 @@ namespace msgpack23 {
245
throw std::length_error("Variant is too long to be serialized.");
246
247
emplace_integral(index);
248
+ data_.resize(data.size() + data.size());
249
data_.insert(data_.end(), data.begin(), data.end());
250
251
0 commit comments