lean4-htt/src/util/null_ostream.h
Leonardo de Moura 370f9a6eec fix(library/trace): use null output channel when trace environment is not set
This is important when multiple threads are being used, and the trace
environment is not set for a child thread
2015-12-08 18:37:57 -08:00

23 lines
510 B
C++

/*
Copyright (c) 2015 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#pragma once
#include <iostream>
#define LEAN_NULL_AUX_BUFFER_SIZE 64
namespace lean {
class null_streambuf : public std::streambuf {
char m_buffer[LEAN_NULL_AUX_BUFFER_SIZE];
protected:
virtual int overflow(int c) override;
};
class null_ostream : public std::ostream {
public:
null_streambuf * rdbuf() const;
};
}