From ca57a4d640aee04ef373a50b24e79d85f0bb91a0 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sat, 27 Jul 2019 10:52:46 -0400 Subject: SERVER-40160 Remove `if_constexpr.h` header. This header circumvented bad formatting which `clang-format-3.8` imparted to `if constexpr`. Now `clang-format-7.0.1` imparts a reasonable format to `if constexpr` so this header is not needed anymore. --- src/mongo/executor/remote_command_request.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/mongo/executor/remote_command_request.cpp') diff --git a/src/mongo/executor/remote_command_request.cpp b/src/mongo/executor/remote_command_request.cpp index e46b483a9cf..be7ce253dd9 100644 --- a/src/mongo/executor/remote_command_request.cpp +++ b/src/mongo/executor/remote_command_request.cpp @@ -35,7 +35,6 @@ #include "mongo/bson/simple_bsonobj_comparator.h" #include "mongo/platform/atomic_word.h" -#include "mongo/util/if_constexpr.h" #include "mongo/util/str.h" using namespace fmt::literals; @@ -82,7 +81,7 @@ RemoteCommandRequestImpl::RemoteCommandRequestImpl(RequestId requestId, Milliseconds timeoutMillis) : RemoteCommandRequestBase(requestId, theDbName, theCmdObj, metadataObj, opCtx, timeoutMillis), target(theTarget) { - IF_CONSTEXPR(std::is_same_v>) { + if constexpr (std::is_same_v>) { invariant(!theTarget.empty()); } } @@ -106,10 +105,9 @@ template std::string RemoteCommandRequestImpl::toString() const { str::stream out; out << "RemoteCommand " << id << " -- target:"; - IF_CONSTEXPR(std::is_same_v) { + if constexpr (std::is_same_v) { out << target.toString(); - } - else { + } else { out << "[{}]"_format(fmt::join(target, ", ")); } out << " db:" << dbname; -- cgit v1.2.1