public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Brian McGrew <brian@visionpro.com>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: std::iostream help
Date: Tue, 17 Mar 2009 20:00:00 -0000	[thread overview]
Message-ID: <C5E54EC0.14894%brian@visionpro.com> (raw)

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

             reply	other threads:[~2009-03-17 20:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17 20:00 Brian McGrew [this message]
2009-03-18 17:46 ` John (Eljay) Love-Jensen
2009-03-18 19:02 ` John Fine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C5E54EC0.14894%brian@visionpro.com \
    --to=brian@visionpro.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).