File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1155,10 +1155,14 @@ Value const& Value::operator[](CppTL::ConstString const& key) const {
1155
1155
}
1156
1156
#endif
1157
1157
1158
- Value& Value::append (const Value& value) { return (*this )[size ()] = value; }
1159
-
1158
+ Value& Value::append (const Value& value) { return append (Value (value)); }
1160
1159
Value& Value::append (Value&& value) {
1161
- return (*this )[size ()] = std::move (value);
1160
+ JSON_ASSERT_MESSAGE (type () == nullValue || type () == arrayValue,
1161
+ " in Json::Value::append: requires arrayValue" );
1162
+ if (type () == nullValue) {
1163
+ *this = Value (arrayValue);
1164
+ }
1165
+ return this ->value_ .map_ ->emplace (size (), std::move (value)).first ->second ;
1162
1166
}
1163
1167
1164
1168
Value Value::get (char const * begin,
You can’t perform that action at this time.
0 commit comments