StuBS
|
Ignore all data passed by the stream operator. More...
#include <nullstream.h>
Public Member Functions | |
NullStream () | |
Empty default constructor. | |
template<typename T > | |
NullStream & | operator<< (T value) |
Generic stream operator for any data type. | |
Private Member Functions | |
template<typename T > | |
auto | check (T v, OutputStream *p=nullptr) -> decltype(*p<< v, void()) |
Check if type is supported by output stream. | |
Ignore all data passed by the stream operator.
Can be used instead of the OutputStream if (for debugging reasons) all output should be ignored, e.g. for DBG_VERBOSE
By using template programming, a single generic methods is sufficient (which simply discard everything).
|
inline |
Generic stream operator for any data type.
Uses template meta programming for a generic & short solution
T | Type of data to ignore |
value | data to be ignore |