[format] %d, %u etc. with (unsigned) char types

I couldn't find anything on this in the list archives or the format docs, but it seems likely to have been asked before so apologies if that is the case. I would expect something like: boost::format fmt("%d"); fmt % char(0); std::cout << fmt; to output "0" given that %d is explicitly specified. This isn't the case (with VC++ 7.1 and GCC 3.4 at least, and presumably all others given this is normal stream behaviour). Obviously it can be worked around by casting to a non-char type, but that seems a shame given the nature of the library and not having to worry about type-safety too much. So, is this by design or accident? If not by design, would it be possible to change the behaviour (specialisation somewhere for (unsigned) char types or something??)? Thanks in advance Luke Elliott.
participants (1)
-
Luke Elliott