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