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 #include +// 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;