boost::pfr with customized member
You need to provide operator<<
for S1
, as boost::pfr::io
relies on it existing:
std::ostream& operator<<(std::ostream& os, const S1& x)
{
return os << boost::pfr::io_fields(x);
}
live example on godbolt.org