mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Added << ostream overload to StringRef
This commit is contained in:
		| @@ -173,7 +173,7 @@ namespace Catch { | ||||
|         return StringRef( lhs ) + rhs; | ||||
|     } | ||||
|  | ||||
|     std::ostream& operator << ( std::ostream& os, StringRef const& str ) { | ||||
|     auto operator << ( std::ostream& os, StringRef const& str ) -> std::ostream& { | ||||
|         return os << str.c_str(); | ||||
|     } | ||||
|          | ||||
|   | ||||
| @@ -9,6 +9,7 @@ | ||||
|  | ||||
| #include <cstddef> | ||||
| #include <string> | ||||
| #include <iosfwd> | ||||
|  | ||||
| namespace Catch { | ||||
|      | ||||
| @@ -76,7 +77,9 @@ namespace Catch { | ||||
|     auto operator + ( StringRef const& lhs, StringRef const& rhs ) -> String; | ||||
|     auto operator + ( StringRef const& lhs, char const* rhs ) -> String; | ||||
|     auto operator + ( char const* lhs, StringRef const& rhs ) -> String; | ||||
|      | ||||
|  | ||||
|     auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&; | ||||
|  | ||||
| } // namespace Catch | ||||
|  | ||||
| #endif // CATCH_STRINGREF_H_INCLUDED | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash