I would like to know what function/s and/or operators must be implemented within a class to work with the boost::format % operator.
For example:
class A
{
int n;
// <-- What additional operator/s and/or function/s must be provided?
}
A a;
boost::format f("%1%");
f % a;
I have been studying Pretty-print C++ STL containers, which is related in some ways to my question, but this has sent me into days of related review and learning regarding issues involving auto and various other language features. I’m not yet done with all of this investigation.
Can someone answer this specific question?
You just need to define a proper output operator(
operator<<):