Added more features to the automated field name retrieval

This commit is contained in:
Patrick Urbanke
2023-11-27 19:51:30 +01:00
parent 5e6682df5d
commit ac244c082d
67 changed files with 6538 additions and 6136 deletions
+15 -13
View File
@@ -7,19 +7,21 @@
#include "write_and_read.hpp"
void test_string_unordered_map() {
std::cout << "test_string_unordered_map" << std::endl;
namespace test_string_unordered_map {
void test() {
std::cout << "test_string_unordered_map" << std::endl;
using Map = std::unordered_map<std::string, std::unique_ptr<std::string>>;
Map 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")));
using Map = std::unordered_map<std::string, std::unique_ptr<std::string>>;
Map 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")));
// Unordered maps are unpredictable. We therefore only make sure that this
// compiles.
const auto json_string = rfl::json::write(homer);
const auto homer2 = rfl::json::read<Map>(json_string);
std::cout << "OK" << std::endl << std::endl;
// Unordered maps are unpredictable. We therefore only make sure that this
// compiles.
const auto json_string = rfl::json::write(homer);
const auto homer2 = rfl::json::read<Map>(json_string);
std::cout << "OK" << std::endl << std::endl;
}
} // namespace test_string_unordered_map