From 9f0d4a3e43786d006e96babad79b94bfcf5e8dc8 Mon Sep 17 00:00:00 2001 From: Ben Caimano Date: Thu, 5 Nov 2020 23:57:39 +0000 Subject: SERVER-52731 Made StatusWith types/constants inline --- src/mongo/base/status_with.h | 12 ++++-------- 1 file 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 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 -extern constexpr bool isStatusWith = false; +inline constexpr bool isStatusWith = false; template -extern constexpr bool isStatusWith> = true; +inline constexpr bool isStatusWith> = true; template -extern constexpr bool isStatusOrStatusWith = - std::is_same::value || isStatusWith; +inline constexpr bool isStatusOrStatusWith = std::is_same_v || isStatusWith; template -using StatusOrStatusWith = std::conditional_t::value, Status, StatusWith>; +using StatusOrStatusWith = std::conditional_t, Status, StatusWith>; /** * StatusWith is used to return an error or a value. -- cgit v1.2.1