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.
This commit is contained in:
Martin Hořeňovský 2019-11-04 00:05:32 +01:00
parent 4f0de7bbad
commit c165bd15c5
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A

View File

@ -9,6 +9,8 @@
#ifndef TWOBLUECUBES_CATCH_STREAM_H_INCLUDED #ifndef TWOBLUECUBES_CATCH_STREAM_H_INCLUDED
#define TWOBLUECUBES_CATCH_STREAM_H_INCLUDED #define TWOBLUECUBES_CATCH_STREAM_H_INCLUDED
#include "catch_common.h"
#include <iosfwd> #include <iosfwd>
#include <cstddef> #include <cstddef>
#include <ostream> #include <ostream>
@ -28,7 +30,7 @@ namespace Catch {
auto makeStream( StringRef const &filename ) -> IStream const*; auto makeStream( StringRef const &filename ) -> IStream const*;
class ReusableStringStream { class ReusableStringStream : NonCopyable {
std::size_t m_index; std::size_t m_index;
std::ostream* m_oss; std::ostream* m_oss;
public: public: