Endgame-Analyzer/include/null_buffer.h

26 lines
423 B
C
Raw Normal View History

#ifndef DYNAMIC_PROGRAM_NULL_BUFFER_H
#define DYNAMIC_PROGRAM_NULL_BUFFER_H
2023-11-15 23:07:39 +01:00
#include <iosfwd>
namespace NullBuffer {
class NullBuffer final : public std::streambuf {
public:
int overflow(int c) override { return c; }
};
class NullStream final : public std::ostream {
public:
NullStream() : std::ostream(&_m_sb) {}
private:
NullBuffer _m_sb;
};
NullStream null_stream;
}
#endif //DYNAMIC_PROGRAM_NULL_BUFFER_H