mirror of
https://github.com/nlohmann/json.git
synced 2025-07-06 06:42:33 +03:00
reorganized repo
This commit is contained in:
17
doc/examples/basic_json__copyassignment.cpp
Normal file
17
doc/examples/basic_json__copyassignment.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include <json.hpp>
|
||||
|
||||
using namespace nlohmann;
|
||||
|
||||
int main()
|
||||
{
|
||||
// create JSON values
|
||||
json a = 23;
|
||||
json b = 42;
|
||||
|
||||
// copy-assign a to b
|
||||
b = a;
|
||||
|
||||
// serialize the JSON arrays
|
||||
std::cout << a << '\n';
|
||||
std::cout << b << '\n';
|
||||
}
|
Reference in New Issue
Block a user