How do I print boolean values with boost::format
as symbolic values?
Can this be done without boost::io::group
? It seems that flags sent to the stream beforehand get retested:
#include <iomanip>
#include <iostream>
#include <boost/format.hpp>
int main()
{
std::cout
<< std::boolalpha
<< true << " "
<< boost::format("%1% %2%\n")
% true
% boost::io::group(std::boolalpha, true)
;
}
Output
true 1 true