operator__equal.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 several JSON values
00008     json array_1 = {1, 2, 3};
00009     json array_2 = {1, 2, 4};
00010     json object_1 = {{"A", "a"}, {"B", "b"}};
00011     json object_2 = {{"B", "b"}, {"A", "a"}};
00012     json number_1 = 17;
00013     json number_2 = 17.000000000000001L;
00014     json string_1 = "foo";
00015     json string_2 = "bar";
00016 
00017     // output values and comparisons
00018     std::cout << std::boolalpha;
00019     std::cout << array_1 << " == " << array_2 << " " << (array_1 == array_2) << '\n';
00020     std::cout << object_1 << " == " << object_2 << " " << (object_1 == object_2) << '\n';
00021     std::cout << number_1 << " == " << number_2 << " " << (number_1 == number_2) << '\n';
00022     std::cout << string_1 << " == " << string_2 << " " << (string_1 == string_2) << '\n';
00023 }


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