Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2017-08-14 08:50:44 +0100
committerPhil Nash2017-08-14 08:50:44 +0100
commitfa3535e95e79ffc9776cc0b43248a108b173b323 (patch)
tree0f1dbc24fa392079b18958b36f60567c62ab1003 /include
parentbb8c1fb17f5d0369c2a49505ca4ea0f77d0f636d (diff)
downloadcatch3-fa3535e95e79ffc9776cc0b43248a108b173b323.tar.gz
Added << ostream overload to StringRef
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_stringref.cpp2
-rw-r--r--include/internal/catch_stringref.h5
2 files changed, 5 insertions, 2 deletions
diff --git a/include/internal/catch_stringref.cpp b/include/internal/catch_stringref.cpp
index 9a1eaf4c..7d117018 100644
--- a/include/internal/catch_stringref.cpp
+++ b/include/internal/catch_stringref.cpp
@@ -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();
}
diff --git a/include/internal/catch_stringref.h b/include/internal/catch_stringref.h
index cde0667a..1f8412de 100644
--- a/include/internal/catch_stringref.h
+++ b/include/internal/catch_stringref.h
@@ -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