1
0
mirror of https://github.com/nlohmann/json synced 2024-12-02 00:20:06 +00:00
nlohmannjson/doc/examples/basic_json__const_int.cpp

16 lines
230 B
C++
Raw Normal View History

2015-06-22 21:21:49 +00:00
#include <json.hpp>
using namespace nlohmann;
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';
}