basic_json__moveconstructor.cpp 287 B

1234567891011121314151617
  1. #include <iostream>
  2. #include <nlohmann/json.hpp>
  3. using json = nlohmann::json;
  4. int main()
  5. {
  6. // create a JSON value
  7. json a = 23;
  8. // move contents of a to b
  9. json b(std::move(a));
  10. // serialize the JSON arrays
  11. std::cout << a << '\n';
  12. std::cout << b << '\n';
  13. }