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

This commit is contained in:
Eddie 2018-10-09 18:42:34 -07:00 committed by Martin Hořeňovský
parent f1faaa9c10
commit 6cede0101a
2 changed files with 9 additions and 8 deletions

View File

@ -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

View File

@ -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;