From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2004-10-29 23:09:26
On Fri, 29 Oct 2004 13:26:34 +0400, Maxim Yegorushkin <e-maxim_at_[hidden]> wrote:
> Daniel Frey <daniel.frey_at_[hidden]> wrote:
> >> logger("app.gui") << "something GUIsh";
> >> Though I am not sure, if a compiler will be able to optimize checks
> >> for every operator<<() to a single check for the entire output
> >> expression.
> > Now replace "something GUIsh" with anExpensiveFunction(). John's code
> > will not evaluate it when the logger is disabled. OTOH your code will
> > always evaluate it, which is IMHO not acceptable for a logging library.
> Well, that is true, though my logging needs has never required calling any
> expensive functions.
All of the iostreams functions add up fast. Its a huge win to not
have to evaluate them if you're not going to log the message. Its a
-- Caleb Epstein caleb.epstein_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk