Endgame-Analyzer/include/null_buffer.h
Maximilian Keßler 32af52ae9e
Rework CLI
This should cover all use cases / exceptions now and is in a reasonably
good code state.
2023-11-12 17:30:44 +01:00

25 lines
424 B
C++

#ifndef DYNAMIC_PROGRAM_NULL_BUFFER_H
#define DYNAMIC_PROGRAM_NULL_BUFFER_H
#include <ostream>
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