I know that Boost.Pfr can be used to iterate the fields of a type, and visit them as a T&, but since T& can't be cast to T A::*, I'm wondering if there's something in the library I missed that can allow visiting fields as member pointers.
#include <boost/pfr.hpp>
struct A {
int number;
string text;
};
int main() {
boost::pfr::for_each_field(A{1,"foo"},
[](auto A::* field) { // wish this or something similar were possible
}
);
}