
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(); Best, John -- John Torjo, Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/ -v1.6.3 (Resource Splitter) -- http://www.torjo.com/cb/ - Click, Build, Run!