Files
CPM.cmake/examples/json/main.cpp
Lars Melchior e0bfe05874 update examples
2019-05-19 19:03:56 +02:00

26 lines
447 B
C++

#include <nlohmann/json.hpp>
#include <iostream>
#include <iomanip>
int main(){
nlohmann::json json = {
{"pi", 3.141},
{"happy", true},
{"name", "Niels"},
{"nothing", nullptr},
{"answer", {
{"everything", 42}
}},
{"list", {1, 0, 2}},
{"object", {
{"currency", "USD"},
{"value", 42.99}
}}
};
std::cout << "declared JSON object: " << std::setw(2) << json << std::endl;
return 0;
}