![]() |
Home | Libraries | People | FAQ | More |
boost::pfr::names_as_array — Creates a std::array from names of fields of an simple aggregate T.
// In header: <boost/pfr/core_name.hpp> template<typename T> std::array< std::string_view, boost::pfr::tuple_size_v< T > > names_as_array();
Example:
struct my_struct { int i, short s; }; std::array<std::string_view, 2> a = boost::pfr::names_as_array<my_struct>(); assert(a[0] == "i");