Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2005-04-26 05:14:32

Felipe Magno de Almeida wrote:

> I mean something like:
> #ifndef NDEBUG
> inline
> #endif
> log_stream &operator <<(log_stream &stream, int i)
> {
> #ifdef NDEBUG
> code that puts the int in the stream
> #endif
> return stream;
> }
> I dont see why a compiler would be passing the stream around, mainly
> with the operator being inline.
> That way we dont need to use macros in the client code, that makes the
> code a little ugly in my opinion...
> The only problem that I see is for:
> stream << "testing";
> where at least in my compiler (VC7.1) these strings are shipped even
> when not used... for embedded systems these strings really get the
> code much bigger... As I've tried it with BREW...

And let's not forget:

stream << long_computing_func();


John Torjo,    Contributing editor, C/C++ Users Journal
-- "Win32 GUI Generics" -- generics & GUI do mix, after all
-- -v1.6.3 (Resource Splitter)
-- - Click, Build, Run!

Boost list run by bdawes at, gregod at, cpdaniel at, john at