opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
null_ostream.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <cstddef>
6#include <ostream>
7
8namespace osc
9{
10 // a `std::ostream` that performs no actual input-output operations
11 class NullOstream final : public std::ostream {
12 public:
13 NullOstream() : std::ostream{&streambuf_} {}
14
15 size_t num_chars_written() const
16 {
17 return streambuf_.num_chars_written();
18 }
19
20 bool was_written_to() const
21 {
22 return streambuf_.was_written_to();
23 }
24 private:
25 NullStreambuf streambuf_;
26 };
27}
Definition null_ostream.h:11
size_t num_chars_written() const
Definition null_ostream.h:15
NullOstream()
Definition null_ostream.h:13
bool was_written_to() const
Definition null_ostream.h:20
Definition null_streambuf.h:10
size_t num_chars_written() const
Definition null_streambuf.h:12
bool was_written_to() const
Definition null_streambuf.h:17
Definition custom_decoration_generator.h:5
constexpr U to(T &&value)
Definition conversion.h:56