
5 Sep
2025
5 Sep
'25
3:56 p.m.
Greetings, I'd like to replace a call to io_fields like this std::ostream& operator<<(std::ostream& os, const my_struct& x) { return os << boost::pfr::io_fields(x); // Equivalent to: os << "{ " << x.i << " ," << x.s << " }" } In such a way that the names of the fields are printed too so it should something like os << "{ " << "x: " << x.i << " ," << "y: " << x.s << " }" Is this possible and if yes what would be the most straightforward way? Regards