summaryrefslogtreecommitdiff
path: root/src/mongo/base
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2015-01-03 10:55:42 -0500
committerAndrew Morrow <acm@mongodb.com>2015-02-13 13:01:12 -0500
commit05d73815c390e344842ac8870acfea53498279ea (patch)
treef47dd823f6b7982df32480eb14c5834277fd72ce /src/mongo/base
parentc1b5595b5fdf93e0599bbdd4154f35bfa10fadd1 (diff)
downloadmongo-05d73815c390e344842ac8870acfea53498279ea.tar.gz
SERVER-16559 Require C++11 and remove conditional compilation
Diffstat (limited to 'src/mongo/base')
-rw-r--r--src/mongo/base/data_view.h5
-rw-r--r--src/mongo/base/status-inl.h6
-rw-r--r--src/mongo/base/status.h7
-rw-r--r--src/mongo/base/status_test.cpp3
4 files changed, 6 insertions, 15 deletions
diff --git a/src/mongo/base/data_view.h b/src/mongo/base/data_view.h
index 9b3bf3aa727..abc6b57f4c6 100644
--- a/src/mongo/base/data_view.h
+++ b/src/mongo/base/data_view.h
@@ -28,13 +28,10 @@
#pragma once
#include <cstring>
+#include <type_traits>
#include "mongo/platform/endian.h"
-#if __cplusplus >= 201103L
-#include <type_traits>
-#endif
-
namespace mongo {
class ConstDataView {
diff --git a/src/mongo/base/status-inl.h b/src/mongo/base/status-inl.h
index 221ba20e53d..880f548a87b 100644
--- a/src/mongo/base/status-inl.h
+++ b/src/mongo/base/status-inl.h
@@ -45,19 +45,17 @@ namespace mongo {
return *this;
}
-#if __cplusplus >= 201103L
- inline Status::Status(Status&& other) noexcept
+ inline Status::Status(Status&& other) BOOST_NOEXCEPT
: _error(other._error) {
other._error = nullptr;
}
- inline Status& Status::operator=(Status&& other) noexcept {
+ inline Status& Status::operator=(Status&& other) BOOST_NOEXCEPT {
unref(_error);
_error = other._error;
other._error = nullptr;
return *this;
}
-#endif // __cplusplus >= 201103L
inline Status::~Status() {
unref(_error);
diff --git a/src/mongo/base/status.h b/src/mongo/base/status.h
index 2b32ecc1a89..e8b82023179 100644
--- a/src/mongo/base/status.h
+++ b/src/mongo/base/status.h
@@ -27,6 +27,7 @@
#pragma once
+#include <boost/config.hpp>
#include <iosfwd>
#include <string>
@@ -75,10 +76,8 @@ namespace mongo {
inline Status(const Status& other);
inline Status& operator=(const Status& other);
-#if __cplusplus >= 201103L
- inline Status(Status&& other) noexcept;
- inline Status& operator=(Status&& other) noexcept;
-#endif // __cplusplus >= 201103L
+ inline Status(Status&& other) BOOST_NOEXCEPT;
+ inline Status& operator=(Status&& other) BOOST_NOEXCEPT;
inline ~Status();
diff --git a/src/mongo/base/status_test.cpp b/src/mongo/base/status_test.cpp
index 28d48c26b28..89184140ab7 100644
--- a/src/mongo/base/status_test.cpp
+++ b/src/mongo/base/status_test.cpp
@@ -67,7 +67,6 @@ namespace {
ASSERT_EQUALS(orig.refCount(), 2U);
}
-#if __cplusplus >= 201103L
TEST(Cloning, MoveCopyOK) {
Status orig = Status::OK();
ASSERT_TRUE(orig.isOK());
@@ -184,8 +183,6 @@ namespace {
ASSERT_EQUALS(dest.refCount(), 0U);
}
-#endif // __cplusplus >= 201103L
-
TEST(Cloning, OKIsNotRefCounted) {
ASSERT_EQUALS(Status::OK().refCount(), 0U);