This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
std::iostream help
- From: Brian McGrew <brian at visionpro dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 17 Mar 2009 12:57:36 -0700
- Subject: std::iostream help
Greetings...
I need a wrapper to use around std::iostream...
Right now, I have this:
std::iostream debug_out;
And I use it the same way you¹d use std::cout...
Debug_out << ³Debug Message² << std::endl;
And it works fine.
But, debug_out gets used in millions of places in my code, so, somehow I
need to come up with a wrapper around the std::iostream to check the debug
level... I realize the below isn¹t valid code (I tried) but, will give and
idea of what I want to do:
U_short TH_ALGO_DEBUG = 0;
If (TH_ALGO_DEBUG > 0) {
std::iostream debug_out;
}
So I want debug_out to only with if debug is greater than zero; without
having to change the debug_out call in millions of places in my code?!?!?!
Please help!
-b