Код: Выделить всё
#include
#include
struct Foo {
int x;
int y;
};
void PrintFoo(const Foo& foo) {
constexpr auto members =
define_static_array(nonstatic_data_members_of(^^Foo, std::meta::access_context::current()));
template for (constexpr auto member : members) {
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79823450/is-there-anyway-to-iterate-data-members-with-stl-algorithms-using-the-c26-refl[/url]