namespace std { void swap(nlohmann::basic_json& j1, nlohmann::basic_json& j2); }
Exchanges the values of two JSON objects.
j1
(in, out) : value to be replaced by j2
j2
(in, out) : value to be replaced by j1
void swap(nlohmann::basic_json& j1, nlohmann::basic_json& j2) { j1.swap(j2); }
??? example
The following code shows how two values are swapped with `std::swap`. ```cpp --8<-- "examples/std_swap.cpp" ``` Output: ```json --8<-- "examples/std_swap.output" ```