W
William Payne
Hi, I have a function declared as:
void foo(const std::string& s, std:stream& verbose_output);
I want foo() to write a lot of data to the ostream if it's a valid stream.
If it's valid or not should depend on user input (command line arguments
actually). If the user decides he/she wants verbose output, I will pass
std::cout as the last argument when calling foo(). But what should I pass if
the user doesn't want any output? And how should foo() check if the stream
is good? verbose_output.good()?.
Thanks for any replies
/ WP
void foo(const std::string& s, std:stream& verbose_output);
I want foo() to write a lot of data to the ostream if it's a valid stream.
If it's valid or not should depend on user input (command line arguments
actually). If the user decides he/she wants verbose output, I will pass
std::cout as the last argument when calling foo(). But what should I pass if
the user doesn't want any output? And how should foo() check if the stream
is good? verbose_output.good()?.
Thanks for any replies
/ WP