From 66ab942903aaaaf3b6606a8125e55d0d844d7478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sat, 30 May 2020 15:43:37 +0200 Subject: [PATCH] Refactor StreamEndStop slightly --- src/catch2/internal/catch_common.cpp | 4 ---- src/catch2/internal/catch_common.hpp | 14 +++++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/catch2/internal/catch_common.cpp b/src/catch2/internal/catch_common.cpp index 5398540f..aaf08079 100644 --- a/src/catch2/internal/catch_common.cpp +++ b/src/catch2/internal/catch_common.cpp @@ -33,8 +33,4 @@ namespace Catch { return os; } - std::string StreamEndStop::operator+() const { - return std::string(); - } - } // end namespace Catch diff --git a/src/catch2/internal/catch_common.hpp b/src/catch2/internal/catch_common.hpp index cc090533..a46c46b3 100644 --- a/src/catch2/internal/catch_common.hpp +++ b/src/catch2/internal/catch_common.hpp @@ -9,6 +9,7 @@ #define TWOBLUECUBES_CATCH_COMMON_H_INCLUDED #include +#include #define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line #define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) @@ -70,12 +71,15 @@ namespace Catch { // as well as // >> stuff +StreamEndStop struct StreamEndStop { - std::string operator+() const; + StringRef operator+() const { + return StringRef(); + } + + template + friend T const& operator + ( T const& value, StreamEndStop ) { + return value; + } }; - template - T const& operator + ( T const& value, StreamEndStop ) { - return value; - } } #define CATCH_INTERNAL_LINEINFO \