summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2016-12-22 11:28:01 -0500
committerMark Benvenuto <mark.benvenuto@mongodb.com>2016-12-22 11:28:01 -0500
commit46f05091c9a7d46b3233a12f28d04e29b6f1dfc9 (patch)
treeaf7993d71ed99a532782fb8fb888fe8f583778fc
parent79631667e6a9371c0a664898256c863afa0f7dd7 (diff)
downloadmongo-46f05091c9a7d46b3233a12f28d04e29b6f1dfc9.tar.gz
SERVER-24398 Remove use of boost NOEXCEPT macros in favor of true C++11 noexcept
-rw-r--r--src/mongo/base/status-inl.h4
-rw-r--r--src/mongo/base/status.h5
-rw-r--r--src/mongo/base/system_error.cpp12
-rw-r--r--src/mongo/db/pipeline/value_internal.h5
-rw-r--r--src/mongo/unittest/unittest.cpp2
-rw-r--r--src/mongo/unittest/unittest.h4
6 files changed, 12 insertions, 20 deletions
diff --git a/src/mongo/base/status-inl.h b/src/mongo/base/status-inl.h
index b8277668fc8..a29678e67b2 100644
--- a/src/mongo/base/status-inl.h
+++ b/src/mongo/base/status-inl.h
@@ -44,11 +44,11 @@ inline Status& Status::operator=(const Status& other) {
return *this;
}
-inline Status::Status(Status&& other) BOOST_NOEXCEPT : _error(other._error) {
+inline Status::Status(Status&& other) noexcept : _error(other._error) {
other._error = nullptr;
}
-inline Status& Status::operator=(Status&& other) BOOST_NOEXCEPT {
+inline Status& Status::operator=(Status&& other) noexcept {
unref(_error);
_error = other._error;
other._error = nullptr;
diff --git a/src/mongo/base/status.h b/src/mongo/base/status.h
index a0cb50beee9..19b74a5a8cb 100644
--- a/src/mongo/base/status.h
+++ b/src/mongo/base/status.h
@@ -27,7 +27,6 @@
#pragma once
-#include <boost/config.hpp>
#include <iosfwd>
#include <string>
@@ -91,8 +90,8 @@ public:
inline Status(const Status& other);
inline Status& operator=(const Status& other);
- inline Status(Status&& other) BOOST_NOEXCEPT;
- inline Status& operator=(Status&& other) BOOST_NOEXCEPT;
+ inline Status(Status&& other) noexcept;
+ inline Status& operator=(Status&& other) noexcept;
inline ~Status();
diff --git a/src/mongo/base/system_error.cpp b/src/mongo/base/system_error.cpp
index 0443590b8e1..8af0d86384d 100644
--- a/src/mongo/base/system_error.cpp
+++ b/src/mongo/base/system_error.cpp
@@ -28,7 +28,6 @@
#include "mongo/platform/basic.h"
-#include <boost/config.hpp>
#include <string>
#include "mongo/base/system_error.h"
@@ -44,7 +43,7 @@ class MongoErrorCategoryImpl final : public std::error_category {
public:
MongoErrorCategoryImpl() = default;
- const char* name() const BOOST_NOEXCEPT override {
+ const char* name() const noexcept override {
return "mongo";
}
@@ -53,15 +52,12 @@ public:
}
// We don't really want to override this function, but to override the second we need to,
- // otherwise there will be issues with overload resolution. Additionally, the use of
- // BOOST_NOEXCEPT is necessitated by the libc++/libstdc++ STL having 'noexcept' on the
- // overridden methods, but not the Dinkumware STL as of MSVC 2013.
- bool equivalent(const int code,
- const std::error_condition& condition) const BOOST_NOEXCEPT override {
+ // otherwise there will be issues with overload resolution.
+ bool equivalent(const int code, const std::error_condition& condition) const noexcept override {
return std::error_category::equivalent(code, condition);
}
- bool equivalent(const std::error_code& code, int condition) const BOOST_NOEXCEPT override {
+ bool equivalent(const std::error_code& code, int condition) const noexcept override {
switch (ErrorCodes::fromInt(condition)) {
case ErrorCodes::OK:
// Make ErrorCodes::OK to be equivalent to the default constructed error code.
diff --git a/src/mongo/db/pipeline/value_internal.h b/src/mongo/db/pipeline/value_internal.h
index 51d76e6cf73..d6238cc869f 100644
--- a/src/mongo/db/pipeline/value_internal.h
+++ b/src/mongo/db/pipeline/value_internal.h
@@ -29,7 +29,6 @@
#pragma once
#include <algorithm>
-#include <boost/config.hpp>
#include <boost/intrusive_ptr.hpp>
#include "mongo/base/static_assert.h"
@@ -169,7 +168,7 @@ public:
memcpyed();
}
- ValueStorage(ValueStorage&& rhs) BOOST_NOEXCEPT {
+ ValueStorage(ValueStorage&& rhs) noexcept {
memcpy(this, &rhs, sizeof(*this));
rhs.zero(); // Reset rhs to the missing state. TODO consider only doing this if refCounter.
}
@@ -197,7 +196,7 @@ public:
return *this;
}
- ValueStorage& operator=(ValueStorage&& rhs) BOOST_NOEXCEPT {
+ ValueStorage& operator=(ValueStorage&& rhs) noexcept {
DEV verifyRefCountingIfShould();
if (refCounter)
intrusive_ptr_release(genericRCPtr);
diff --git a/src/mongo/unittest/unittest.cpp b/src/mongo/unittest/unittest.cpp
index 94eb315d23a..a39383a79a2 100644
--- a/src/mongo/unittest/unittest.cpp
+++ b/src/mongo/unittest/unittest.cpp
@@ -453,7 +453,7 @@ TestAssertionFailure& TestAssertionFailure::operator=(const TestAssertionFailure
return *this;
}
-TestAssertionFailure::~TestAssertionFailure() BOOST_NOEXCEPT_IF(false) {
+TestAssertionFailure::~TestAssertionFailure() noexcept(false) {
if (!_enabled) {
invariant(_stream.str().empty());
return;
diff --git a/src/mongo/unittest/unittest.h b/src/mongo/unittest/unittest.h
index 427b8551fcd..6bb7bffdff8 100644
--- a/src/mongo/unittest/unittest.h
+++ b/src/mongo/unittest/unittest.h
@@ -40,8 +40,6 @@
#include <utility>
#include <vector>
-#include <boost/config.hpp>
-
#include "mongo/base/status_with.h"
#include "mongo/logger/logstream_builder.h"
#include "mongo/logger/message_log_domain.h"
@@ -502,7 +500,7 @@ class TestAssertionFailure {
public:
TestAssertionFailure(const std::string& file, unsigned line, const std::string& message);
TestAssertionFailure(const TestAssertionFailure& other);
- ~TestAssertionFailure() BOOST_NOEXCEPT_IF(false);
+ ~TestAssertionFailure() noexcept(false);
TestAssertionFailure& operator=(const TestAssertionFailure& other);