![]() |
Home | Libraries | People | FAQ | More |
pfr::for_each_field_with_name
// In header: <pfr/core_name.hpp> template<typename T, typename F> constexpr void for_each_field_with_name(T && value, F && func);
Calls func
for each field with its name of a value
Example:
struct Toto { int a; char c; }; Toto t {5, 'c'}; auto print = [](std::string_view name, const auto& value){ std::cout << "Name: " << name << " Value: " << value << std::endl; }; for_each_field_with_name(t, print);
Parameters: |
|