Re: Manipulator question...
On May 25, 9:10 pm, "BobR" <removeBadB...@worldnet.att.net> wrote:
[...]
Really hard for a 'newbie' to write a super-duper manipulator class if you
don't know the basics of the streams.
Example:
Hey, OP, do you know what "RAII" is? Exceptions? 'pass by value' vs. 'p=
ass
by reference'?
A newbie asking a question here presumably wants to learn. What
bothers me most is the number of experienced programmers who
don't know how to right a manipulator. Or perhap rather, who
don't know when they should write one.
Maybe he/she knows them, but I couldn't tell from the original post.
Yes. My goal here was just to throw out ideas. After that, the
original poster can adopt his own policies, according to his
level (but hopefully, he will be stimulated to find out about
RAII). (I know of at least one very competent programmer who
solves the problem by always setting everything, i.e.:
std::cout << std::dec << i ;
systematically. That's also a solution.)
I am certainly not arguing with you (who be WAY up the mountain from me).
Just attempting to give my logic in answering the OP. <G>
I wasn't complaining about your solution; I use it myself often
enough. I just thought it worth pointing out that there are
really a lot of solutions (and no one right answer).
--
James Kanze (Gabi Software) email: james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34