mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-02 00:00:26 +02:00
Shamelessly copy Josiah
This commit is contained in:
18
source/lib/json/docs/examples/basic_json__copyassignment.cpp
Normal file
18
source/lib/json/docs/examples/basic_json__copyassignment.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
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