Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Fix different operator<< overload sets used for SFINAE and insertion

Commit
6cede0101ada18017c817e1afa68a4835f785e0c
Author
Eddie ·
Committer
Martin Hořeňovský
Parents
f1faaa9c1071

Files · Download .tar.gz

Changes

 include/internal/catch_common.h   | 9 +++++++++
 include/internal/catch_tostring.h | 8 --------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h
index 4aaf80c5..b332e164 100644
--- a/include/internal/catch_common.h
+++ b/include/internal/catch_common.h
@@ -22,6 +22,10 @@
 #include <string>
 #include <cstdint>
 
+// We need a dummy global operator<< so we can bring it into Catch namespace later
+struct Catch_global_namespace_dummy {};
+std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy);
+
 namespace Catch {
 
     struct CaseSensitive { enum Choice {
@@ -63,6 +67,11 @@ namespace Catch {
 
     std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info );
 
+    // Bring in operator<< from global namespace into Catch namespace
+    // This is necessary because the overload of operator<< above makes
+    // lookup stop at namespace Catch
+    using ::operator<<;
+
     // Use this in variadic streaming macros to allow
     //    >> +StreamEndStop
     // as well as
diff --git a/include/internal/catch_tostring.h b/include/internal/catch_tostring.h
index 137d9759..3aff268b 100644
--- a/include/internal/catch_tostring.h
+++ b/include/internal/catch_tostring.h
@@ -29,15 +29,7 @@
 #pragma warning(disable:4180) // We attempt to stream a function (address) by const&, which MSVC complains about but is harmless
 #endif
 
-
-// We need a dummy global operator<< so we can bring it into Catch namespace later
-struct Catch_global_namespace_dummy {};
-std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy);
-
 namespace Catch {
-    // Bring in operator<< from global namespace into Catch namespace
-    using ::operator<<;
-
     namespace Detail {
 
         extern const std::string unprintableString;