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

_______________________________________________
Boost-users mailing list -- boost-users@lists.boost.org
To unsubscribe send an email to boost-users-le...@lists.boost.org
https://lists.boost.org/mailman3/lists/boost-users.lists.boost.org/
Archived at: 
https://lists.boost.org/archives/list/boost-users@lists.boost.org/message/ZQOGJENMFEGGGHBXLI4AMKWOWEJI7UCX/
 

Reply via email to