diff options
author | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-06-10 01:21:01 -0400 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-06-10 01:59:35 -0400 |
commit | c36f9ecb91e49da7e637863889804fc4e6c6c05e (patch) | |
tree | 64d8aadb6d29042d4f4e7366bc1457e4e0612383 /src/mongo/platform | |
parent | c9548e729c8fecd9d7a9a5dd341da0433194ac73 (diff) | |
download | mongo-c36f9ecb91e49da7e637863889804fc4e6c6c05e.tar.gz |
SERVER-39339 Remove `stdx/memory.h`
Diffstat (limited to 'src/mongo/platform')
-rw-r--r-- | src/mongo/platform/decimal128_bson_test.cpp | 2 | ||||
-rw-r--r-- | src/mongo/platform/decimal128_test.cpp | 42 | ||||
-rw-r--r-- | src/mongo/platform/random.cpp | 10 | ||||
-rw-r--r-- | src/mongo/platform/shared_library_posix.cpp | 2 |
4 files changed, 28 insertions, 28 deletions
diff --git a/src/mongo/platform/decimal128_bson_test.cpp b/src/mongo/platform/decimal128_bson_test.cpp index 9cfbeca8bdb..fb2a2a702df 100644 --- a/src/mongo/platform/decimal128_bson_test.cpp +++ b/src/mongo/platform/decimal128_bson_test.cpp @@ -35,6 +35,7 @@ #include <array> #include <cmath> +#include <memory> #include <utility> #include "mongo/bson/bsonelement.h" @@ -43,7 +44,6 @@ #include "mongo/config.h" #include "mongo/db/json.h" #include "mongo/platform/decimal128.h" -#include "mongo/stdx/memory.h" #include "mongo/unittest/unittest.h" #include "mongo/util/hex.h" #include "mongo/util/log.h" diff --git a/src/mongo/platform/decimal128_test.cpp b/src/mongo/platform/decimal128_test.cpp index dfce92f4fb8..1f0362e6a3a 100644 --- a/src/mongo/platform/decimal128_test.cpp +++ b/src/mongo/platform/decimal128_test.cpp @@ -31,11 +31,11 @@ #include <array> #include <cmath> +#include <memory> #include <string> #include <utility> #include "mongo/config.h" -#include "mongo/stdx/memory.h" #include "mongo/unittest/unittest.h" namespace mongo { @@ -345,7 +345,7 @@ TEST(Decimal128Test, TestDecimal128ToInt32Even) { int32_t out[6] = {-3, -2, -2, 2, 2, 3}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toInt(), out[testNo]); } } @@ -356,7 +356,7 @@ TEST(Decimal128Test, TestDecimal128ToInt32Neg) { int32_t out[6] = {-3, -3, -3, 2, 2, 2}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toInt(roundMode), out[testNo]); } } @@ -367,7 +367,7 @@ TEST(Decimal128Test, TestDecimal128ToInt32Pos) { int32_t out[6] = {-2, -2, -2, 3, 3, 3}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toInt(roundMode), out[testNo]); } } @@ -378,7 +378,7 @@ TEST(Decimal128Test, TestDecimal128ToInt32Zero) { int32_t out[6] = {-2, -2, -2, 2, 2, 2}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toInt(roundMode), out[testNo]); } } @@ -389,7 +389,7 @@ TEST(Decimal128Test, TestDecimal128ToInt32Away) { int32_t out[6] = {-3, -3, -2, 2, 3, 3}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toInt(roundMode), out[testNo]); } } @@ -404,7 +404,7 @@ TEST(Decimal128Test, TestDecimal128ToInt64Even) { int64_t out[6] = {-4294967297, -4294967296, -4294967296, 4294967296, 4294967296, 4294967297}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toLong(), out[testNo]); } } @@ -420,7 +420,7 @@ TEST(Decimal128Test, TestDecimal128ToInt64Neg) { int64_t out[6] = {-4294967297, -4294967297, -4294967297, 4294967296, 4294967296, 4294967296}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toLong(roundMode), out[testNo]); } } @@ -436,7 +436,7 @@ TEST(Decimal128Test, TestDecimal128ToInt64Pos) { int64_t out[6] = {-4294967296, -4294967296, -4294967296, 4294967297, 4294967297, 4294967297}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toLong(roundMode), out[testNo]); } } @@ -452,7 +452,7 @@ TEST(Decimal128Test, TestDecimal128ToInt64Zero) { int64_t out[6] = {-4294967296, -4294967296, -4294967296, 4294967296, 4294967296, 4294967296}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toLong(roundMode), out[testNo]); } } @@ -468,7 +468,7 @@ TEST(Decimal128Test, TestDecimal128ToInt64Away) { int64_t out[6] = {-4294967297, -4294967297, -4294967296, 4294967296, 4294967297, 4294967297}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toLong(roundMode), out[testNo]); } } @@ -478,7 +478,7 @@ TEST(Decimal128Test, TestDecimal128ToInt32ExactEven) { int32_t out[6] = {-3, -2, -2, 2, 2, 3}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toIntExact(), out[testNo]); } } @@ -489,7 +489,7 @@ TEST(Decimal128Test, TestDecimal128ToInt32ExactNeg) { int32_t out[6] = {-3, -3, -3, 2, 2, 2}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toIntExact(roundMode), out[testNo]); } } @@ -500,7 +500,7 @@ TEST(Decimal128Test, TestDecimal128ToInt32ExactPos) { int32_t out[6] = {-2, -2, -2, 3, 3, 3}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toIntExact(roundMode), out[testNo]); } } @@ -511,7 +511,7 @@ TEST(Decimal128Test, TestDecimal128ToInt32ExactZero) { int32_t out[6] = {-2, -2, -2, 2, 2, 2}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toIntExact(roundMode), out[testNo]); } } @@ -522,7 +522,7 @@ TEST(Decimal128Test, TestDecimal128ToInt32ExactAway) { int32_t out[6] = {-3, -3, -2, 2, 3, 3}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toIntExact(roundMode), out[testNo]); } } @@ -537,7 +537,7 @@ TEST(Decimal128Test, TestDecimal128ToInt64ExactEven) { int64_t out[6] = {-4294967297, -4294967296, -4294967296, 4294967296, 4294967296, 4294967297}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toLongExact(), out[testNo]); } } @@ -553,7 +553,7 @@ TEST(Decimal128Test, TestDecimal128ToInt64ExactNeg) { int64_t out[6] = {-4294967297, -4294967297, -4294967297, 4294967296, 4294967296, 4294967296}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toLongExact(roundMode), out[testNo]); } } @@ -569,7 +569,7 @@ TEST(Decimal128Test, TestDecimal128ToInt64ExactPos) { int64_t out[6] = {-4294967296, -4294967296, -4294967296, 4294967297, 4294967297, 4294967297}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toLongExact(roundMode), out[testNo]); } } @@ -585,7 +585,7 @@ TEST(Decimal128Test, TestDecimal128ToInt64ExactZero) { int64_t out[6] = {-4294967296, -4294967296, -4294967296, 4294967296, 4294967296, 4294967296}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toLongExact(roundMode), out[testNo]); } } @@ -601,7 +601,7 @@ TEST(Decimal128Test, TestDecimal128ToInt64ExactAway) { int64_t out[6] = {-4294967297, -4294967297, -4294967296, 4294967296, 4294967297, 4294967297}; std::unique_ptr<Decimal128> decPtr; for (int testNo = 0; testNo < 6; ++testNo) { - decPtr = stdx::make_unique<Decimal128>(in[testNo]); + decPtr = std::make_unique<Decimal128>(in[testNo]); ASSERT_EQUALS(decPtr->toLongExact(roundMode), out[testNo]); } } diff --git a/src/mongo/platform/random.cpp b/src/mongo/platform/random.cpp index ec46ce8c2cc..f12ffb57a5d 100644 --- a/src/mongo/platform/random.cpp +++ b/src/mongo/platform/random.cpp @@ -46,8 +46,8 @@ #include <fstream> #include <iostream> #include <limits> +#include <memory> -#include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" @@ -144,7 +144,7 @@ private: }; std::unique_ptr<SecureRandom> SecureRandom::create() { - return stdx::make_unique<WinSecureRandom>(); + return std::make_unique<WinSecureRandom>(); } #elif defined(__linux__) || defined(__sun) || defined(__APPLE__) || defined(__FreeBSD__) || \ @@ -153,7 +153,7 @@ std::unique_ptr<SecureRandom> SecureRandom::create() { class InputStreamSecureRandom : public SecureRandom { public: InputStreamSecureRandom(const char* fn) { - _in = stdx::make_unique<std::ifstream>(fn, std::ios::binary | std::ios::in); + _in = std::make_unique<std::ifstream>(fn, std::ios::binary | std::ios::in); if (!_in->is_open()) { error() << "cannot open " << fn << " " << strerror(errno); fassertFailed(28839); @@ -175,7 +175,7 @@ private: }; std::unique_ptr<SecureRandom> SecureRandom::create() { - return stdx::make_unique<InputStreamSecureRandom>("/dev/urandom"); + return std::make_unique<InputStreamSecureRandom>("/dev/urandom"); } #elif defined(__OpenBSD__) @@ -190,7 +190,7 @@ public: }; std::unique_ptr<SecureRandom> SecureRandom::create() { - return stdx::make_unique<Arc4SecureRandom>(); + return std::make_unique<Arc4SecureRandom>(); } #else diff --git a/src/mongo/platform/shared_library_posix.cpp b/src/mongo/platform/shared_library_posix.cpp index 16728da3d12..a383efab94e 100644 --- a/src/mongo/platform/shared_library_posix.cpp +++ b/src/mongo/platform/shared_library_posix.cpp @@ -34,8 +34,8 @@ #include <boost/filesystem.hpp> #include <dlfcn.h> +#include <memory> -#include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" #include "mongo/util/str.h" |