26 Jun
2011
26 Jun
'11
11:25 p.m.
I brought this up a while back, and I ran into it again yesterday. Using boost::format to produce a string, as opposed to sending it directly to cout, is awkward. boost::format ("blah blah blah") % exp1 % exp2 %exp3 is fine in and of itself. But then what? You need to wrap the whole thing in extra parens to use str: std::string s= (boost::format ("blah blah blah") % exp1 % exp2 %exp3).str(); WHY NOT allow implicit conversion to string? Or, some other mechanism that doesn't complicate the expression and bury the interesting part? —John