Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorMartin Hořeňovský2019-11-04 00:05:32 +0100
committerMartin Hořeňovský2019-11-04 00:05:35 +0100
commit95bfb331674ffe5abd411ddaceb86896f97dca08 (patch)
treedf66de65a513adef123c5832360b15f2e6eed0c6 /include
parent59d2d08c0fb1a65c5a9acee4aa4a8b8bcc0bb140 (diff)
downloadcatch3-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.h4
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: