StuBS
NullStream Class Reference

Ignore all data passed by the stream operator. More...

#include <nullstream.h>

Public Member Functions

 NullStream ()
 Empty default constructor.
 
template<typename T >
NullStreamoperator<< (T value)
 Generic stream operator for any data type. More...
 

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.
 

Detailed Description

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).

Member Function Documentation

◆ operator<<()

template<typename T >
NullStream & NullStream::operator<< ( value)
inline

Generic stream operator for any data type.

Uses template meta programming for a generic & short solution

Template Parameters
TType of data to ignore
Parameters
valuedata to be ignore
Returns
Reference to the NullStream object allowing concatenation of operators

The documentation for this class was generated from the following file: