MCPcopy Create free account
hub / github.com/alibaba/yalantinglibs / use_smart_pointer

Function use_smart_pointer

src/struct_json/examples/main.cpp:70–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68YLT_REFL(person1, name, age);
69
70void use_smart_pointer() {
71 person1 p{std::make_shared<std::string>("tom"),
72 std::make_unique<int64_t>(42)};
73 std::string str;
74 iguana::to_json(p, str);
75
76 person1 p1;
77 iguana::from_json(p1, str);
78
79 assert(*p1.name == "tom");
80 assert(*p1.age == 42);
81}
82
83void test_escape_serialize() {
84#ifdef __linux__

Callers 1

mainFunction · 0.85

Calls 2

to_jsonFunction · 0.85
from_jsonFunction · 0.85

Tested by

no test coverage detected