mirror of
https://github.com/nlohmann/json.git
synced 2026-10-25 23:38:58 +00:00
803 B
803 B
Unreleased
These changes are part of the develop branch, but not of a release yet.
- Converting an rvalue container to JSON (
json j = std::move(vec);,json j = std::map<std::string, std::string>{...};) now moves the elements instead of copying them (e.g.,std::vector<std::string>with 100,000 strings: 4.7 ms to 2.3 ms). Two consequences: the source container is left in a valid but unspecified (moved-from) state, and if an exception is thrown during the conversion, the source may be partially moved-from, so the strong exception guarantee no longer holds for the source of an rvalue conversion (the JSON value itself is unaffected). Lvalues andconstobjects are still copied. Seebasic_json.