From cb2a2843597af344db54a2ed34885e204fed5c0f Mon Sep 17 00:00:00 2001 From: Peter Keresztes Schmidt Date: Mon, 7 Sep 2020 00:22:37 +0200 Subject: Core/ChatCommands: Move ostream operator into Variant class so we don't pollute std:: (PR #25413) (cherry picked from commit 68a4085427a898046b4afb73f6c369640418b848) --- src/server/game/Chat/ChatCommands/ChatCommandTags.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Chat/ChatCommands/ChatCommandTags.h b/src/server/game/Chat/ChatCommands/ChatCommandTags.h index 19872430f1c..19d3258753c 100644 --- a/src/server/game/Chat/ChatCommands/ChatCommandTags.h +++ b/src/server/game/Chat/ChatCommands/ChatCommandTags.h @@ -258,17 +258,13 @@ namespace Trinity::ChatCommands template constexpr bool holds_alternative() const { return std::holds_alternative(static_cast(*this)); } - }; -} -/* make the correct operator<< to use explicit, because otherwise the compiler gets confused with the implicit std::variant conversion */ -namespace std -{ - template - auto operator<<(std::ostream& os, Trinity::ChatCommands::Variant const& v) -> std::enable_if_t::have_operators, std::ostream&> - { - return (os << *v); - } + template + friend std::enable_if_t operator<<(std::ostream& os, Trinity::ChatCommands::Variant const& v) + { + return (os << *v); + } + }; } #endif -- cgit v1.2.3