Add an insert overload function (#1110)

This commit is contained in:
Chen
2019-12-03 09:13:42 +08:00
committed by GitHub
parent 9e0d70aa66
commit a0bd9adfef
3 changed files with 9 additions and 4 deletions

View File

@@ -417,8 +417,7 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, arrayInsertAtRandomIndex) {
}
vec.push_back(&array[4]);
// insert rvalue at the tail
Json::Value index5("index5");
JSONTEST_ASSERT(array.insert(5, std::move(index5)));
JSONTEST_ASSERT(array.insert(5, "index5"));
JSONTEST_ASSERT_EQUAL(Json::Value("index3"), array[0]);
JSONTEST_ASSERT_EQUAL(Json::Value("index0"), array[1]);
JSONTEST_ASSERT_EQUAL(Json::Value("index4"), array[2]);