Boost logo

Boost :

From: Patrick Bennett (patrick.bennett_at_[hidden])
Date: 2005-04-26 00:13:28

Felipe Magno de Almeida wrote:

>couldn't a macro disable code like:
>stream << a << b << c
>making operator << a "do nothing" function? I dont think it will have
>any overhead in the release code... maybe just for strings "of this
>type" that normally isnt optimized away...
Could it completely 'remove' the code? Not that I know of.
Although, there's no reason a decent compiler wouldn't detect something
like this (which the macro could be changed into with a 'don't compile'
compilation option) and not emit code for it.
if (1) ; else someStream() << a << b << c;

Patrick Bennett

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