diff options
| author | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-07-27 10:52:46 -0400 |
|---|---|---|
| committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-07-27 11:13:28 -0400 |
| commit | ca57a4d640aee04ef373a50b24e79d85f0bb91a0 (patch) | |
| tree | 12e465b472499631f7b2bd4ad7a1084b41ec2404 /src/mongo/executor/remote_command_request.cpp | |
| parent | 134a4083953270e8a11430395357fb70a29047ad (diff) | |
| download | mongo-ca57a4d640aee04ef373a50b24e79d85f0bb91a0.tar.gz | |
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.
Diffstat (limited to 'src/mongo/executor/remote_command_request.cpp')
| -rw-r--r-- | src/mongo/executor/remote_command_request.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
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<T>::RemoteCommandRequestImpl(RequestId requestId, Milliseconds timeoutMillis) : RemoteCommandRequestBase(requestId, theDbName, theCmdObj, metadataObj, opCtx, timeoutMillis), target(theTarget) { - IF_CONSTEXPR(std::is_same_v<T, std::vector<HostAndPort>>) { + if constexpr (std::is_same_v<T, std::vector<HostAndPort>>) { invariant(!theTarget.empty()); } } @@ -106,10 +105,9 @@ template <typename T> std::string RemoteCommandRequestImpl<T>::toString() const { str::stream out; out << "RemoteCommand " << id << " -- target:"; - IF_CONSTEXPR(std::is_same_v<HostAndPort, T>) { + if constexpr (std::is_same_v<HostAndPort, T>) { out << target.toString(); - } - else { + } else { out << "[{}]"_format(fmt::join(target, ", ")); } out << " db:" << dbname; |
