diff options
Diffstat (limited to 'src/stream.h')
-rw-r--r-- | src/stream.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/stream.h b/src/stream.h index 919c801d..ddc5369a 100644 --- a/src/stream.h +++ b/src/stream.h @@ -61,7 +61,7 @@ namespace ledger { * Cline's "C++ FAQ Lite". Arguably this should be three different * classes, but that introduces additional unneeded complications. */ -class output_stream_t : public noncopyable +class output_stream_t { private: int pipe_to_pager_fd; @@ -81,6 +81,16 @@ public: } /** + * When copy-constructed, make the copy just be a new output stream. This + * allows large classes to rely on their default copy-constructor without + * worrying about pointer copying within output_stream_t. + */ + output_stream_t(const output_stream_t& other) + : pipe_to_pager_fd(-1), os(&std::cout) { + TRACE_CTOR(output_stream_t, "copy"); + } + + /** * Destroys an output_stream_t. This deletes the dynamically * allocated ostream, if necessary. It also closes output file * descriptor, if necessary. |