basic_json__CompatibleIntegerNumberType.cpp
Go to the documentation of this file.
00001 #include <json.hpp>
00002 
00003 using json = nlohmann::json;
00004 
00005 int main()
00006 {
00007     // create values of different integer types
00008     short n42 = 42;
00009     int n23 = 23;
00010     long n1024 = 1024;
00011     int_least32_t n17 = 17;
00012     uint8_t n8 = 8;
00013 
00014     // create JSON numbers
00015     json j42(n42);
00016     json j23(n23);
00017     json j1024(n1024);
00018     json j17(n17);
00019     json j8(n8);
00020 
00021     // serialize the JSON numbers
00022     std::cout << j42 << '\n';
00023     std::cout << j23 << '\n';
00024     std::cout << j1024 << '\n';
00025     std::cout << j17 << '\n';
00026     std::cout << j8 << '\n';
00027 }


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:01