Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 7th, 2008, 06:25 PM
Gennaro Prota
Guest
 
Posts: n/a
Default Re: Predictably formated output with std::cout?

Carsten Fuchs wrote:
Quote:
[...]
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.
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles