Open matus-chochlik opened 3 years ago
struct S { int i{0}; }
consteval auto reflect_S_i() { using namespace std::experimental::meta; return *members_of(^S, is_data_member).begin(); };
auto main() -> int { S s{}; const auto mp = &([: reflect_S_i() :]); (s.*mp) = 1; return 0; }
include <experimental/compiler>
include <experimental/meta>
struct S { int i{0}; }
consteval auto reflect_S_i() { using namespace std::experimental::meta; return *members_of(^S, is_data_member).begin(); };
auto main() -> int { S s{}; const auto mp = &([: reflect_S_i() :]); (s.*mp) = 1; return 0; }