mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-17 06:37:43 -05:00
* 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
18 lines
533 B
C++
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;
|
|
}
|