I 'd obviously use IOstreams with disabling/enabling the output amounting to setting/clearing std::ios_base::failbit
. Doing this will readily prevent formatting and writing the data. It won't prevent evaluation of arguments, though. For that purpose I'd use the logical and operator:
si && si << not_evaluated() << when_not_used();