mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-17 14:47:30 -05:00
26 lines
447 B
C++
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;
|
|
}
|