Carsten Fuchs wrote:
> [...]
> It's certainly possible to reset or properly set all the flags prior to
> each cout output manually, but in practice, that's infeasible (e.g. when
> one third-party library sets certain flags, and the other doesn't have
> the "reset" code) and cumbersome (the flags setup code would be a lot
> longer than the actual cout << i; statement).
You might want to look at the I/O Stream-State Saver Library, in Boost.
Personally, I find that they went for a too fine-grained set of
classes and have my own saver, but your mileage may vary. Differently
from Boost, anyway, I have on my side that James Kanze also uses a
single saver class in the code available at his site

(Seriously,
it's likely that James' code was written way before Boost had a State
Saver library, but still I make a point that his solution is a winner
in terms of simplicity and maintenance cost)
--
Gennaro Prota | <https://sourceforge.net/projects/breeze/>
Do you need expertise in C++? I'm available.