diff options
| author | Martin Hořeňovský | 2019-11-04 00:05:32 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2019-11-04 00:05:35 +0100 |
| commit | 95bfb331674ffe5abd411ddaceb86896f97dca08 (patch) | |
| tree | df66de65a513adef123c5832360b15f2e6eed0c6 /include | |
| parent | 59d2d08c0fb1a65c5a9acee4aa4a8b8bcc0bb140 (diff) | |
| download | catch3-95bfb331674ffe5abd411ddaceb86896f97dca08.tar.gz | |
Forbid copying ReusableStringStream
Copying a `ReusableStringStream` would lead to "double free" of
the stream, and thus it could be used in multiple places at the
same time, breaking the output.
Diffstat (limited to 'include')
| -rw-r--r-- | include/internal/catch_stream.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/internal/catch_stream.h b/include/internal/catch_stream.h index 2b41adbd..999849c9 100644 --- a/include/internal/catch_stream.h +++ b/include/internal/catch_stream.h @@ -9,6 +9,8 @@ #ifndef TWOBLUECUBES_CATCH_STREAM_H_INCLUDED #define TWOBLUECUBES_CATCH_STREAM_H_INCLUDED +#include "catch_common.h" + #include <iosfwd> #include <cstddef> #include <ostream> @@ -28,7 +30,7 @@ namespace Catch { auto makeStream( StringRef const &filename ) -> IStream const*; - class ReusableStringStream { + class ReusableStringStream : NonCopyable { std::size_t m_index; std::ostream* m_oss; public: |