Merge branch 'develop' into benchmarks/value-operations

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-15 22:46:25 +02:00
commit b604a88dba
7 files changed
+82 -85

No files matched your search

+1 -1
View File
@@ -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)
+3 -8
View File
@@ -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;
};