mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Move specialization for global op<< to the proper place
In v2 it was placed in a very central header due to the way it was stitched together. Now that we don't do that, we can move it to the proper place, removing the potential for confusion given that the original header was split apart and renamed.
This commit is contained in:
parent
4eb9af51af
commit
849002aec0
@ -28,9 +28,18 @@
|
|||||||
#pragma warning(disable:4180) // We attempt to stream a function (address) by const&, which MSVC complains about but is harmless
|
#pragma warning(disable:4180) // We attempt to stream a function (address) by const&, which MSVC complains about but is harmless
|
||||||
#endif
|
#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 {
|
namespace Catch {
|
||||||
|
// Bring in global namespace operator<< for ADL lookup in
|
||||||
|
// `IsStreamInsertable` below.
|
||||||
|
using ::operator<<;
|
||||||
|
|
||||||
namespace Detail {
|
namespace Detail {
|
||||||
|
|
||||||
|
|
||||||
constexpr StringRef unprintableString = "{?}"_sr;
|
constexpr StringRef unprintableString = "{?}"_sr;
|
||||||
|
|
||||||
//! Encases `string in quotes, and optionally escapes invisibles
|
//! Encases `string in quotes, and optionally escapes invisibles
|
||||||
|
@ -11,10 +11,6 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
|
|
||||||
// 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 {
|
namespace Catch {
|
||||||
|
|
||||||
struct SourceLineInfo {
|
struct SourceLineInfo {
|
||||||
@ -33,12 +29,6 @@ namespace Catch {
|
|||||||
|
|
||||||
friend std::ostream& operator << (std::ostream& os, SourceLineInfo const& info);
|
friend 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<<;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CATCH_INTERNAL_LINEINFO \
|
#define CATCH_INTERNAL_LINEINFO \
|
||||||
|
Loading…
Reference in New Issue
Block a user