mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-06 18:56:19 +08:00
Added more features to the automated field name retrieval
This commit is contained in:
@@ -7,14 +7,16 @@
|
||||
|
||||
#include "write_and_read.hpp"
|
||||
|
||||
void test_string_map() {
|
||||
std::cout << "test_string_map" << std::endl;
|
||||
namespace test_string_map {
|
||||
void test() {
|
||||
std::cout << "test_string_map" << std::endl;
|
||||
|
||||
std::map<std::string, std::unique_ptr<std::string>> homer;
|
||||
homer.insert(
|
||||
std::make_pair("firstName", std::make_unique<std::string>("Homer")));
|
||||
homer.insert(
|
||||
std::make_pair("lastName", std::make_unique<std::string>("Simpson")));
|
||||
std::map<std::string, std::unique_ptr<std::string>> homer;
|
||||
homer.insert(
|
||||
std::make_pair("firstName", std::make_unique<std::string>("Homer")));
|
||||
homer.insert(
|
||||
std::make_pair("lastName", std::make_unique<std::string>("Simpson")));
|
||||
|
||||
write_and_read(homer, R"({"firstName":"Homer","lastName":"Simpson"})");
|
||||
write_and_read(homer, R"({"firstName":"Homer","lastName":"Simpson"})");
|
||||
}
|
||||
} // namespace test_string_map
|
||||
|
||||
Reference in New Issue
Block a user