summaryrefslogtreecommitdiff
path: root/src/mongo/base/status_with.h
diff options
context:
space:
mode:
authorBen Caimano <ben.caimano@10gen.com>2020-11-05 23:57:39 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-11-11 00:00:33 +0000
commit9f0d4a3e43786d006e96babad79b94bfcf5e8dc8 (patch)
tree3a7b8d03274c7a7b68f16d8aec4280d78f0e4908 /src/mongo/base/status_with.h
parente73f614e223781e613453a795e99d1d494ec44b7 (diff)
downloadmongo-9f0d4a3e43786d006e96babad79b94bfcf5e8dc8.tar.gz
SERVER-52731 Made StatusWith types/constants inline
Diffstat (limited to 'src/mongo/base/status_with.h')
-rw-r--r--src/mongo/base/status_with.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mongo/base/status_with.h b/src/mongo/base/status_with.h
index b4e2654f815..22e6854c636 100644
--- a/src/mongo/base/status_with.h
+++ b/src/mongo/base/status_with.h
@@ -52,20 +52,16 @@ class StringBuilderImpl;
template <typename T>
class StatusWith;
-// Using extern constexpr to prevent the compiler from allocating storage as a poor man's c++17
-// inline constexpr variable.
-// TODO delete extern in c++17 because inline is the default for constexpr variables.
template <typename T>
-extern constexpr bool isStatusWith = false;
+inline constexpr bool isStatusWith = false;
template <typename T>
-extern constexpr bool isStatusWith<StatusWith<T>> = true;
+inline constexpr bool isStatusWith<StatusWith<T>> = true;
template <typename T>
-extern constexpr bool isStatusOrStatusWith =
- std::is_same<T, mongo::Status>::value || isStatusWith<T>;
+inline constexpr bool isStatusOrStatusWith = std::is_same_v<T, Status> || isStatusWith<T>;
template <typename T>
-using StatusOrStatusWith = std::conditional_t<std::is_void<T>::value, Status, StatusWith<T>>;
+using StatusOrStatusWith = std::conditional_t<std::is_void_v<T>, Status, StatusWith<T>>;
/**
* StatusWith is used to return an error or a value.