Lines Matching defs:name
41 struct name
44 name(std::string rhs = "") : m_val(std::move(rhs)) {}
56 name m_name{};
59 person(const age& a, name n, const country& c) : m_age(a), m_name(std::move(n)), m_country(c) {}
72 name m_book_name{};
75 contact_book(name n, std::vector<contact> c) : m_book_name(std::move(n)), m_contacts(std::move(c)) {}
90 static void to_json(BasicJsonType& j, const name& n)
117 j = BasicJsonType{{"age", p.m_age}, {"name", p.m_name}, {"country", p.m_country}};
132 j = json{{"name", cb.m_book_name}, {"contacts", cb.m_contacts}};
146 static bool operator==(const name& lhs, const name& rhs)
179 static void from_json(const BasicJsonType& j, name& n)
204 p.m_name = j["name"].template get<name>();
221 cb.m_book_name = j["name"].get<name>();
234 const udt::name n{"theo"};
247 CHECK(json(sfinae_addict) == R"({"name":"theo", "age":23, "country":"France"})"_json);
250 R"({"person" : {"age":23, "name":"theo", "country":"France"}, "address":"Paris"})"_json);
254 R"({"name":"C++", "contacts" : [{"person" : {"age":23, "name":"theo", "country":"France"}, "address":"Paris"}, {"person" : {"age":42, "country":"中华人民共和国", "name":"王芳"}, "address":"Paris"}]})"_json);
261 R"({"name":"C++", "contacts" : [{"person" : {"age":23, "name":"theo", "country":"France"}, "address":"Paris"}, {"person" : {"age":42, "country":"中华人民共和国", "name":"王芳"}, "address":"Paris"}]})"_json;
265 const auto book_name = big_json["name"].get<udt::name>();
275 const auto name = contact_json["person"]["name"].get<udt::name>();
278 CHECK(name == n);
284 CHECK(book_name == udt::name{"C++"});
291 udt::name name;
297 person_json["name"].get_to(name).m_val = "new name";
298 CHECK(name.m_val == "new name");
305 const udt::name book_name = big_json["name"];
313 const udt::name name = contact_json["person"]["name"];
316 CHECK(name == n);
322 CHECK(book_name == udt::name{"C++"});