json/doc/mkdocs/docs/api/basic_json/std_swap.md
2021-11-06 15:37:40 +01:00

428 B

std::swap<basic_json>

namespace std {
    void swap(nlohmann::basic_json& j1, nlohmann::basic_json& j2);
}

Exchanges the values of two JSON objects.

Possible implementation

void swap(nlohmann::basic_json& j1, nlohmann::basic_json& j2)
{
    j1.swap(j2);
}

See also

Version history

  • Added in version 1.0.0.
  • Extended for arbitrary basic_json types in version 3.10.5.