mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-25 23:06:10 +01:00
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:
parent
4f0de7bbad
commit
c165bd15c5
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user