mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Make IStream::stream non-const
This way it makes much more sense from logically-const point of view, and also means that concrete implementations don't have to always have a `mutable` keyword on the stream member.
This commit is contained in:
		| @@ -21,9 +21,9 @@ namespace { | ||||
|     }; | ||||
|  | ||||
|     class TestStringStream : public Catch::IStream { | ||||
|         mutable std::stringstream m_stream; | ||||
|         std::stringstream m_stream; | ||||
|     public: | ||||
|         std::ostream& stream() const override { | ||||
|         std::ostream& stream() override { | ||||
|             return m_stream; | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -29,10 +29,10 @@ | ||||
| namespace { | ||||
|     class StringIStream : public Catch::IStream { | ||||
|     public: | ||||
|         std::ostream& stream() const override { return sstr; } | ||||
|         std::ostream& stream() override { return sstr; } | ||||
|         std::string str() const { return sstr.str(); } | ||||
|     private: | ||||
|         mutable std::stringstream sstr; | ||||
|         std::stringstream sstr; | ||||
|     }; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský