This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]