diff options
Diffstat (limited to 'src/mongo/embedded/api_common.h')
-rw-r--r-- | src/mongo/embedded/api_common.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/embedded/api_common.h b/src/mongo/embedded/api_common.h index a0be42d1a34..4070cef85b9 100644 --- a/src/mongo/embedded/api_common.h +++ b/src/mongo/embedded/api_common.h @@ -151,7 +151,7 @@ struct enterCXXImpl; template <typename Status, typename Function> struct enterCXXImpl<Status, Function, void> { template <typename Callable> - static int call(Callable&& function, Status& status, ReentrancyGuard = {}) noexcept { + static int call(Callable&& function, Status& status, const ReentrancyGuard& = {}) noexcept { try { function(); } catch (...) { @@ -165,7 +165,9 @@ struct enterCXXImpl<Status, Function, void> { template <typename Status, typename Function, typename Pointer> struct enterCXXImpl<Status, Function, Pointer*> { template <typename Callable> - static Pointer* call(Callable&& function, Status& status, ReentrancyGuard = {}) noexcept try { + static Pointer* call(Callable&& function, + Status& status, + const ReentrancyGuard& = {}) noexcept try { return function(); } catch (...) { return handleException(status); |