Files
CPM.cmake/examples/json/main.cpp
Lars Melchior 1ebbac6332 Apply clang-format and cmake-format and add style check workflow (#171)
* apply clang-format and cmake-format and add style check workflow

* add declare package definition

* add additional public methods and rename internals

* change development verison tag to 1.0.0

* rename internal method

* rename public method

* rename test var

* update copyright and fix comment

* typo

* run fix-format

* fix test function names
2021-01-06 14:40:33 +01:00

18 lines
533 B
C++

#include <iomanip>
#include <iostream>
#include <nlohmann/json.hpp>
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;
}