#include "test_meta_fields.hpp" #include #include namespace test_meta_fields { struct Person { std::string first_name; std::string last_name = "Simpson"; std::string town = "Springfield"; unsigned int age; std::vector children; }; void test() { std::cout << std::source_location::current().function_name() << std::endl; const auto fields = rfl::fields(); /*std::cout << "Fields in " << rfl::type_name_t().str() << ":" << std::endl; for (const auto& f : fields) { std::cout << "name: " << f.name() << ", type: " << f.type() << std::endl; }*/ // The exact content is somewhat unpredictable, we just want to make sure it // compiles. if (fields.size() == 5) { std::cout << "OK" << std::endl; } } } // namespace test_meta_fields