2015-06-20 22:59:33 +00:00
|
|
|
#include <json.hpp>
|
|
|
|
|
2016-01-30 19:23:14 +00:00
|
|
|
using json = nlohmann::json;
|
2015-06-20 22:59:33 +00:00
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
// create an array_t value
|
|
|
|
json::array_t value = {"one", "two", 3, 4.5, false};
|
|
|
|
|
|
|
|
// create a JSON array from the value
|
|
|
|
json j(value);
|
|
|
|
|
|
|
|
// serialize the JSON array
|
|
|
|
std::cout << j << '\n';
|
|
|
|
}
|