Make io_fields print field names

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
4
Age (days ago)
4
Last active (days ago)
0 comments
1 participants
participants (1)
-
Phil Phil