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/bson/bsonobjbuilder.h | |
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/bson/bsonobjbuilder.h')
-rw-r--r-- | src/mongo/bson/bsonobjbuilder.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mongo/bson/bsonobjbuilder.h b/src/mongo/bson/bsonobjbuilder.h index 1eb052a7c21..de68ff65353 100644 --- a/src/mongo/bson/bsonobjbuilder.h +++ b/src/mongo/bson/bsonobjbuilder.h @@ -50,7 +50,6 @@ #include "mongo/bson/util/builder.h" #include "mongo/platform/decimal128.h" #include "mongo/util/decimal_counter.h" -#include "mongo/util/if_constexpr.h" #include "mongo/util/scopeguard.h" namespace mongo { @@ -262,13 +261,11 @@ public: constexpr BSONType type = BSONObjAppendFormat<T>::value; _b.appendNum(static_cast<char>(type)); _b.appendStr(fieldName); - IF_CONSTEXPR(type == Bool) { + if constexpr (type == Bool) { _b.appendNum(static_cast<char>(n)); - } - else IF_CONSTEXPR(type == NumberInt) { + } else if constexpr (type == NumberInt) { _b.appendNum(static_cast<int>(n)); - } - else { + } else { _b.appendNum(n); } return *this; |