• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <iostream>
2 #include <iomanip>
3 #include <nlohmann/json.hpp>
4 
5 using json = nlohmann::json;
6 
main()7 int main()
8 {
9     // create JSON values
10     json j1 = {{"one", 1}, {"two", 2}};
11     json j2 = {1, 2, 4, 8, 16};
12 
13     std::cout << "j1 = " << j1 << " | j2 = " << j2 << '\n';
14 
15     // swap values
16     std::swap(j1, j2);
17 
18     std::cout << "j1 = " << j1 << " | j2 = " << j2 << std::endl;
19 }
20