mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-23 05:46:11 +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
59d2d08c0f
commit
95bfb33167
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user