json/doc/examples/basic_json__const_int.cpp

16 lines
233 B
C++
Raw Normal View History

2015-06-22 23:21:49 +02:00
#include <json.hpp>
using json = nlohmann::json;
2015-06-22 23:21:49 +02:00
int main()
{
// an anonymous enum
enum { t = 17 };
// create a JSON number from the enum
json j(t);
// serialize the JSON numbers
std::cout << j << '\n';
}