Lines Matching refs:json

4 // |_____|_____|_____|_|___|  https://github.com/nlohmann/json
11 #include <nlohmann/json.hpp>
12 using nlohmann::json;
16 SECTION("container requirements for json")
18 // X: container class: json
19 // T: type of objects: json
20 // a, b: values of type X: json
25 CHECK((std::is_same<json::value_type, json>::value));
28 CHECK((std::is_same<json::reference, json&>::value));
31 CHECK((std::is_same<json::const_reference, const json&>::value));
34 CHECK((std::is_same<json::iterator::value_type, json>::value));
36 CHECK((std::is_base_of<std::forward_iterator_tag, typename std::iterator_traits<json::iterator>::iterator_category>::value));
38 CHECK((std::is_convertible<json::iterator, json::const_iterator>::value));
41 CHECK((std::is_same<json::const_iterator::value_type, json>::value));
43 CHECK((std::is_base_of<std::forward_iterator_tag, typename std::iterator_traits<json::const_iterator>::iterator_category>::value));
46 CHECK((std::is_signed<json::difference_type>::value));
48 CHECK((std::is_same<json::difference_type, json::iterator::difference_type>::value));
50 CHECK((std::is_same<json::difference_type, json::const_iterator::difference_type>::value));
53 CHECK((std::is_unsigned<json::size_type>::value));
55 CHECK(static_cast<json::size_type>((std::numeric_limits<json::difference_type>::max)()) <=
56 (std::numeric_limits<json::size_type>::max)());
60 json u;
65 CHECK(json().empty());
68 SECTION("class json")
72 CHECK(std::is_nothrow_default_constructible<json>::value);
77 CHECK(std::is_move_constructible<json>::value);
78 CHECK(std::is_nothrow_move_constructible<json>::value);
83 CHECK(std::is_copy_constructible<json>::value);
88 CHECK(std::is_nothrow_move_assignable<json>::value);
93 CHECK(std::is_copy_assignable<json>::value);
98 CHECK(std::is_nothrow_destructible<json>::value);
103 CHECK(std::is_standard_layout<json>::value);
111 CHECK(std::is_nothrow_copy_constructible<json::iterator>::value);
112 CHECK(std::is_nothrow_copy_constructible<json::const_iterator>::value);
117 // STL iterators used by json::iterator don't pass this test in Debug mode
119 CHECK(std::is_nothrow_copy_assignable<json::iterator>::value);
120 CHECK(std::is_nothrow_copy_assignable<json::const_iterator>::value);
126 CHECK(std::is_nothrow_destructible<json::iterator>::value);
127 CHECK(std::is_nothrow_destructible<json::const_iterator>::value);
133 json j {1, 2, 3};
134 json::iterator it1 = j.begin();
135 json::iterator it2 = j.end();
141 json j {1, 2, 3};
142 json::const_iterator it1 = j.cbegin();
143 json::const_iterator it2 = j.cend();