mirror of
https://github.com/nlohmann/json.git
synced 2026-10-16 11:17:13 +00:00
Merge branch 'develop' into cbor-integer-writer
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
7 files changed
+82
-85
No files matched your search
@@ -733,7 +733,7 @@ TEST_CASE_TEMPLATE("Parent pointers stay consistent", J, json, ordered_json)
|
||||
TEST_CASE_TEMPLATE("update() and merge_patch() keep parent pointers and diagnostic paths", J, json, ordered_json)
|
||||
{
|
||||
// enough keys to make the vector behind ordered_json reallocate several times
|
||||
const auto make_object = [](int first, int last)
|
||||
const auto make_object = [](int first, int last) -> J
|
||||
{
|
||||
J o = J::object();
|
||||
for (int i = first; i < last; ++i)
|
||||
|
||||
@@ -39,20 +39,15 @@ struct tracked
|
||||
std::string payload;
|
||||
bool moved_from = false;
|
||||
|
||||
explicit tracked(std::string p) : payload(std::move(p)) {}
|
||||
explicit tracked(std::string p) noexcept : payload(std::move(p)) {}
|
||||
tracked(const tracked&) = default;
|
||||
tracked& operator=(const tracked&) = default;
|
||||
tracked(tracked&& other) noexcept : payload(std::move(other.payload)), moved_from(other.moved_from)
|
||||
{
|
||||
other.moved_from = true;
|
||||
}
|
||||
tracked& operator=(tracked&& other) noexcept
|
||||
{
|
||||
payload = std::move(other.payload);
|
||||
moved_from = other.moved_from;
|
||||
other.moved_from = true;
|
||||
return *this;
|
||||
}
|
||||
// not needed by the tests (and an unused definition fails -Wunneeded-member-function)
|
||||
tracked& operator=(tracked&&) = delete;
|
||||
~tracked() = default;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user