diff options
Diffstat (limited to 'src/mongo')
39 files changed, 4 insertions, 344 deletions
diff --git a/src/mongo/base/status-inl.h b/src/mongo/base/status-inl.h index a029544ca87..13209a48e33 100644 --- a/src/mongo/base/status-inl.h +++ b/src/mongo/base/status-inl.h @@ -49,11 +49,6 @@ inline Status::Status(Status&& other) BOOST_NOEXCEPT : _error(other._error) { } inline Status& Status::operator=(Status&& other) BOOST_NOEXCEPT { -#if defined(_MSC_VER) && _MSC_VER < 1900 // MSVC 2013 STL can emit self-move-assign. - if (&other == this) - return *this; -#endif - unref(_error); _error = other._error; other._error = nullptr; diff --git a/src/mongo/base/status_with.h b/src/mongo/base/status_with.h index 1f2c9e85a0e..a7fec54435c 100644 --- a/src/mongo/base/status_with.h +++ b/src/mongo/base/status_with.h @@ -82,24 +82,6 @@ public: */ StatusWith(T t) : _status(Status::OK()), _t(std::move(t)) {} -#if defined(_MSC_VER) && _MSC_VER < 1900 - StatusWith(const StatusWith& s) : _status(s._status), _t(s._t) {} - - StatusWith(StatusWith&& s) : _status(std::move(s._status)), _t(std::move(s._t)) {} - - StatusWith& operator=(const StatusWith& other) { - _status = other._status; - _t = other._t; - return *this; - } - - StatusWith& operator=(StatusWith&& other) { - _status = std::move(other._status); - _t = std::move(other._t); - return *this; - } -#endif - const T& getValue() const { dassert(isOK()); return *_t; diff --git a/src/mongo/bson/util/builder.h b/src/mongo/bson/util/builder.h index 93ddf8dd22a..efbf2c58932 100644 --- a/src/mongo/bson/util/builder.h +++ b/src/mongo/bson/util/builder.h @@ -326,11 +326,6 @@ public: void decouple(); // not allowed. not implemented. }; -#if defined(_WIN32) && _MSC_VER < 1900 -#pragma push_macro("snprintf") -#define snprintf _snprintf -#endif - /** std::stringstream deals with locale so this is a lot faster than std::stringstream for UTF8 */ template <typename Allocator> class StringBuilderImpl { @@ -443,9 +438,4 @@ private: typedef StringBuilderImpl<TrivialAllocator> StringBuilder; typedef StringBuilderImpl<StackAllocator> StackStringBuilder; - -#if defined(_WIN32) && _MSC_VER < 1900 -#undef snprintf -#pragma pop_macro("snprintf") -#endif } // namespace mongo diff --git a/src/mongo/client/connection_pool.cpp b/src/mongo/client/connection_pool.cpp index 21ea1bd5c3b..9fa5493824f 100644 --- a/src/mongo/client/connection_pool.cpp +++ b/src/mongo/client/connection_pool.cpp @@ -263,11 +263,6 @@ ConnectionPool::ConnectionPtr::ConnectionPtr(ConnectionPtr&& other) } ConnectionPool::ConnectionPtr& ConnectionPool::ConnectionPtr::operator=(ConnectionPtr&& other) { -#if defined(_MSC_VER) && _MSC_VER < 1900 // MSVC 2013 STL can emit self-move-assign. - if (&other == this) - return *this; -#endif - _pool = std::move(other._pool); _connInfo = std::move(other._connInfo); other._pool = nullptr; diff --git a/src/mongo/db/auth/authorization_manager.cpp b/src/mongo/db/auth/authorization_manager.cpp index 34d7d37d0b4..df65782689e 100644 --- a/src/mongo/db/auth/authorization_manager.cpp +++ b/src/mongo/db/auth/authorization_manager.cpp @@ -107,12 +107,10 @@ const BSONObj AuthorizationManager::versionDocumentQuery = BSON("_id" const std::string AuthorizationManager::schemaVersionFieldName = "currentVersion"; -#ifndef _MSC_EXTENSIONS const int AuthorizationManager::schemaVersion24; const int AuthorizationManager::schemaVersion26Upgrade; const int AuthorizationManager::schemaVersion26Final; const int AuthorizationManager::schemaVersion28SCRAM; -#endif /** * Guard object for synchronizing accesses to data cached in AuthorizationManager instances. diff --git a/src/mongo/db/catalog/index_create.h b/src/mongo/db/catalog/index_create.h index d3dccb20b46..084149529f1 100644 --- a/src/mongo/db/catalog/index_create.h +++ b/src/mongo/db/catalog/index_create.h @@ -192,25 +192,6 @@ private: class CleanupIndexesVectorOnRollback; struct IndexToBuild { -#if defined(_MSC_VER) && _MSC_VER < 1900 // MVSC++ <= 2013 can't generate default move operations - IndexToBuild() = default; - IndexToBuild(IndexToBuild&& other) - : block(std::move(other.block)), - real(std::move(other.real)), - bulk(std::move(other.bulk)), - options(std::move(other.options)), - filterExpression(std::move(other.filterExpression)) {} - - IndexToBuild& operator=(IndexToBuild&& other) { - block = std::move(other.block); - real = std::move(other.real); - filterExpression = std::move(other.filterExpression); - bulk = std::move(other.bulk); - options = std::move(other.options); - return *this; - } -#endif - std::unique_ptr<IndexCatalog::IndexBuildBlock> block; IndexAccessMethod* real = NULL; // owned elsewhere diff --git a/src/mongo/db/ftdc/file_manager.cpp b/src/mongo/db/ftdc/file_manager.cpp index 9ba445fe2f7..dbefc3fd451 100644 --- a/src/mongo/db/ftdc/file_manager.cpp +++ b/src/mongo/db/ftdc/file_manager.cpp @@ -49,11 +49,6 @@ namespace mongo { -// TODO: See time_support.cpp for details on this interposition -#if defined(_MSC_VER) && _MSC_VER < 1900 -#define snprintf _snprintf -#endif - FTDCFileManager::FTDCFileManager(const FTDCConfig* config, const boost::filesystem::path& path, FTDCCollectorCollection* collection) diff --git a/src/mongo/db/fts/unicode/string.h b/src/mongo/db/fts/unicode/string.h index dac83ed3b24..4c2b656bc6e 100644 --- a/src/mongo/db/fts/unicode/string.h +++ b/src/mongo/db/fts/unicode/string.h @@ -48,15 +48,6 @@ class String { public: String() = default; -#if defined(_MSC_VER) && _MSC_VER < 1900 - String(String&& other) : _data(std::move(other._data)) {} - - String& operator=(String&& other) { - _data = std::move(other._data); - return *this; - } -#endif - /** * Construct a String with UTF-8 source data (supports standard C++ string literals, and * std::strings). diff --git a/src/mongo/db/pipeline/document.h b/src/mongo/db/pipeline/document.h index c0bf581110e..e7584b13ade 100644 --- a/src/mongo/db/pipeline/document.h +++ b/src/mongo/db/pipeline/document.h @@ -79,16 +79,6 @@ public: */ Document(std::initializer_list<std::pair<StringData, ImplicitValue>> initializerList); -#if defined(_MSC_VER) && _MSC_VER < 1900 // MVSC++ <= 2013 can't generate default move operations - Document(const Document& other) = default; - Document& operator=(const Document& other) = default; - Document(Document&& other) : _storage(std::move(other._storage)) {} - Document& operator=(Document&& other) { - _storage = std::move(other._storage); - return *this; - } -#endif - void swap(Document& rhs) { _storage.swap(rhs._storage); } diff --git a/src/mongo/db/pipeline/value.h b/src/mongo/db/pipeline/value.h index 920b5910204..19b951f852c 100644 --- a/src/mongo/db/pipeline/value.h +++ b/src/mongo/db/pipeline/value.h @@ -97,16 +97,6 @@ public: /// Deep-convert from BSONElement to Value explicit Value(const BSONElement& elem); -#if defined(_MSC_VER) && _MSC_VER < 1900 // MVSC++ <= 2013 can't generate default move operations - Value(const Value& other) = default; - Value& operator=(const Value& other) = default; - Value(Value&& other) : _storage(std::move(other._storage)) {} - Value& operator=(Value&& other) { - _storage = std::move(other._storage); - return *this; - } -#endif - /** Construct a long or integer-valued Value. * * Used when preforming arithmetic operations with int where the diff --git a/src/mongo/db/pipeline/value_internal.h b/src/mongo/db/pipeline/value_internal.h index e4aab6a072f..556eebec060 100644 --- a/src/mongo/db/pipeline/value_internal.h +++ b/src/mongo/db/pipeline/value_internal.h @@ -197,11 +197,6 @@ public: } ValueStorage& operator=(ValueStorage&& rhs) BOOST_NOEXCEPT { -#if defined(_MSC_VER) && _MSC_VER < 1900 // MSVC 2013 STL can emit self-move-assign. - if (&rhs == this) - return *this; -#endif - DEV verifyRefCountingIfShould(); if (refCounter) intrusive_ptr_release(genericRCPtr); diff --git a/src/mongo/db/query/cursor_response.cpp b/src/mongo/db/query/cursor_response.cpp index 405f7476d4b..bf812d302a8 100644 --- a/src/mongo/db/query/cursor_response.cpp +++ b/src/mongo/db/query/cursor_response.cpp @@ -103,22 +103,6 @@ CursorResponse::CursorResponse(NamespaceString nss, _batch(std::move(batch)), _numReturnedSoFar(numReturnedSoFar) {} -#if defined(_MSC_VER) && _MSC_VER < 1900 -CursorResponse::CursorResponse(CursorResponse&& other) - : _nss(std::move(other._nss)), - _cursorId(std::move(other._cursorId)), - _batch(std::move(other._batch)), - _numReturnedSoFar(std::move(other._numReturnedSoFar)) {} - -CursorResponse& CursorResponse::operator=(CursorResponse&& other) { - _nss = std::move(other._nss); - _cursorId = std::move(other._cursorId); - _batch = std::move(other._batch); - _numReturnedSoFar = std::move(other._numReturnedSoFar); - return *this; -} -#endif - StatusWith<CursorResponse> CursorResponse::parseFromBSON(const BSONObj& cmdResponse) { Status cmdStatus = getStatusFromCommandResult(cmdResponse); if (!cmdStatus.isOK()) { diff --git a/src/mongo/db/query/cursor_response.h b/src/mongo/db/query/cursor_response.h index 3fe1e56d15f..2eed3db4901 100644 --- a/src/mongo/db/query/cursor_response.h +++ b/src/mongo/db/query/cursor_response.h @@ -136,13 +136,8 @@ public: std::vector<BSONObj> batch, boost::optional<long long> numReturnedSoFar = boost::none); -#if defined(_MSC_VER) && _MSC_VER < 1900 - CursorResponse(CursorResponse&& other); - CursorResponse& operator=(CursorResponse&& other); -#else CursorResponse(CursorResponse&& other) = default; CursorResponse& operator=(CursorResponse&& other) = default; -#endif // // Accessors. diff --git a/src/mongo/db/query/plan_ranker.h b/src/mongo/db/query/plan_ranker.h index 61db71caec2..d01539b847e 100644 --- a/src/mongo/db/query/plan_ranker.h +++ b/src/mongo/db/query/plan_ranker.h @@ -72,24 +72,6 @@ struct CandidatePlan { CandidatePlan(QuerySolution* s, PlanStage* r, WorkingSet* w) : solution(s), root(r), ws(w), failed(false) {} -#if defined(_MSC_VER) && _MSC_VER < 1900 // MVSC++ <= 2013 can't generate default move operations - CandidatePlan(CandidatePlan&& other) - : solution(std::move(other.solution)), - root(std::move(other.root)), - ws(std::move(other.ws)), - results(std::move(other.results)), - failed(std::move(other.failed)) {} - - CandidatePlan& operator=(CandidatePlan&& other) { - solution = std::move(other.solution); - root = std::move(other.root); - ws = std::move(other.ws); - results = std::move(other.results); - failed = std::move(other.failed); - return *this; - } -#endif - std::unique_ptr<QuerySolution> solution; PlanStage* root; // Not owned here. WorkingSet* ws; // Not owned here. diff --git a/src/mongo/db/repl/replica_set_config.cpp b/src/mongo/db/repl/replica_set_config.cpp index ffe928d0081..ff259f5c9c7 100644 --- a/src/mongo/db/repl/replica_set_config.cpp +++ b/src/mongo/db/repl/replica_set_config.cpp @@ -41,10 +41,8 @@ namespace mongo { namespace repl { -#ifndef _MSC_VER const size_t ReplicaSetConfig::kMaxMembers; const size_t ReplicaSetConfig::kMaxVotingMembers; -#endif const std::string ReplicaSetConfig::kConfigServerFieldName = "configsvr"; const std::string ReplicaSetConfig::kVersionFieldName = "version"; diff --git a/src/mongo/db/storage/kv/kv_engine_test_snapshots.cpp b/src/mongo/db/storage/kv/kv_engine_test_snapshots.cpp index 6ff5cb2eeb3..641ffa82a98 100644 --- a/src/mongo/db/storage/kv/kv_engine_test_snapshots.cpp +++ b/src/mongo/db/storage/kv/kv_engine_test_snapshots.cpp @@ -58,12 +58,7 @@ public: } -#if defined(_MSC_VER) && _MSC_VER < 1900 // MSVC 2013 Can't default move constructor. - Operation(Operation&& other) - : _client(std::move(other._client)), _txn(std::move(other._txn)) {} -#else Operation(Operation&& other) = default; -#endif Operation& operator=(Operation&& other) { // Need to assign to _txn first if active. Otherwise we'd destroy _client before _txn. diff --git a/src/mongo/executor/network_interface.cpp b/src/mongo/executor/network_interface.cpp index f025b1b1de3..e19e9284a13 100644 --- a/src/mongo/executor/network_interface.cpp +++ b/src/mongo/executor/network_interface.cpp @@ -36,9 +36,7 @@ namespace executor { // This is a bitmask with the first bit set. It's used to mark connections that should be kept // open during stepdowns. -#ifndef _MSC_EXTENSIONS const unsigned int NetworkInterface::kMessagingPortKeepOpen; -#endif // _MSC_EXTENSIONS NetworkInterface::NetworkInterface() {} NetworkInterface::~NetworkInterface() {} diff --git a/src/mongo/executor/network_interface_asio.cpp b/src/mongo/executor/network_interface_asio.cpp index 27e971f3eb4..4198fb8a0e3 100644 --- a/src/mongo/executor/network_interface_asio.cpp +++ b/src/mongo/executor/network_interface_asio.cpp @@ -62,24 +62,6 @@ const std::size_t kIOServiceWorkers = 1; NetworkInterfaceASIO::Options::Options() = default; -#if defined(_MSC_VER) && _MSC_VER < 1900 -NetworkInterfaceASIO::Options::Options(Options&& other) - : connectionPoolOptions(std::move(other.connectionPoolOptions)), - timerFactory(std::move(other.timerFactory)), - networkConnectionHook(std::move(other.networkConnectionHook)), - streamFactory(std::move(other.streamFactory)), - metadataHook(std::move(other.metadataHook)) {} - -NetworkInterfaceASIO::Options& NetworkInterfaceASIO::Options::operator=(Options&& other) { - connectionPoolOptions = std::move(other.connectionPoolOptions); - timerFactory = std::move(other.timerFactory); - networkConnectionHook = std::move(other.networkConnectionHook); - streamFactory = std::move(other.streamFactory); - metadataHook = std::move(other.metadataHook); - return *this; -} -#endif - NetworkInterfaceASIO::NetworkInterfaceASIO(Options options) : _options(std::move(options)), _io_service(), diff --git a/src/mongo/executor/network_interface_asio.h b/src/mongo/executor/network_interface_asio.h index 62e441d7d92..2bbded1202d 100644 --- a/src/mongo/executor/network_interface_asio.h +++ b/src/mongo/executor/network_interface_asio.h @@ -100,15 +100,6 @@ public: struct Options { Options(); -// Explicit move construction and assignment to support MSVC -#if defined(_MSC_VER) && _MSC_VER < 1900 - Options(Options&&); - Options& operator=(Options&&); -#else - Options(Options&&) = default; - Options& operator=(Options&&) = default; -#endif - std::string instanceName = "NetworkInterfaceASIO"; ConnectionPool::Options connectionPoolOptions; std::unique_ptr<AsyncTimerFactoryInterface> timerFactory; @@ -169,15 +160,6 @@ private: rpc::ProtocolSet clientProtocols() const; void setServerProtocols(rpc::ProtocolSet protocols); -// Explicit move construction and assignment to support MSVC -#if defined(_MSC_VER) && _MSC_VER < 1900 - AsyncConnection(AsyncConnection&&); - AsyncConnection& operator=(AsyncConnection&&); -#else - AsyncConnection(AsyncConnection&&) = default; - AsyncConnection& operator=(AsyncConnection&&) = default; -#endif - private: std::unique_ptr<AsyncStreamInterface> _stream; diff --git a/src/mongo/executor/network_interface_asio_connect.cpp b/src/mongo/executor/network_interface_asio_connect.cpp index 336f0c9ba93..a72db76bfe7 100644 --- a/src/mongo/executor/network_interface_asio_connect.cpp +++ b/src/mongo/executor/network_interface_asio_connect.cpp @@ -55,21 +55,6 @@ NetworkInterfaceASIO::AsyncConnection::AsyncConnection(std::unique_ptr<AsyncStre _clientProtocols(rpc::computeProtocolSet(WireSpec::instance().minWireVersionOutgoing, WireSpec::instance().maxWireVersionOutgoing)) {} -#if defined(_MSC_VER) && _MSC_VER < 1900 -NetworkInterfaceASIO::AsyncConnection::AsyncConnection(AsyncConnection&& other) - : _stream(std::move(other._stream)), - _serverProtocols(other._serverProtocols), - _clientProtocols(other._clientProtocols) {} - -NetworkInterfaceASIO::AsyncConnection& NetworkInterfaceASIO::AsyncConnection::operator=( - AsyncConnection&& other) { - _stream = std::move(other._stream); - _serverProtocols = other._serverProtocols; - _clientProtocols = other._clientProtocols; - return *this; -} -#endif - AsyncStreamInterface& NetworkInterfaceASIO::AsyncConnection::stream() { return *_stream; } diff --git a/src/mongo/executor/network_test_env.h b/src/mongo/executor/network_test_env.h index 0cf769ee9e0..9fe53f07e2c 100644 --- a/src/mongo/executor/network_test_env.h +++ b/src/mongo/executor/network_test_env.h @@ -69,14 +69,7 @@ public: executor::NetworkInterfaceMock* network) : _future(std::move(future)), _executor(executor), _network(network) {} -#if defined(_MSC_VER) && _MSC_VER < 1900 // MVSC++ <= 2013 can't generate default move operations - FutureHandle(FutureHandle&& other) - : _future(std::move(other._future)), - _executor(other._executor), - _network(other._network) {} -#else FutureHandle(FutureHandle&& other) = default; -#endif FutureHandle& operator=(FutureHandle&& other) { // Assigning to initialized FutureHandle is banned because of the work required prior to diff --git a/src/mongo/platform/endian.h b/src/mongo/platform/endian.h index 72c287b12c2..faa6f686e29 100644 --- a/src/mongo/platform/endian.h +++ b/src/mongo/platform/endian.h @@ -70,7 +70,7 @@ #define MONGO_LITTLE_ENDIAN 1234 #define MONGO_BIG_ENDIAN 4321 -#if defined(_MSC_VER) && (_MSC_VER >= 1300) +#if defined(_MSC_VER) #include <cstdlib> #define MONGO_UINT16_SWAB(v) _byteswap_ushort(v) #define MONGO_UINT32_SWAB(v) _byteswap_ulong(v) diff --git a/src/mongo/rpc/metadata/repl_set_metadata.cpp b/src/mongo/rpc/metadata/repl_set_metadata.cpp index c088fe99113..b756019cef3 100644 --- a/src/mongo/rpc/metadata/repl_set_metadata.cpp +++ b/src/mongo/rpc/metadata/repl_set_metadata.cpp @@ -53,9 +53,7 @@ const char kTermFieldName[] = "term"; } // unnamed namespace -#ifndef _MSC_EXTENSIONS const int ReplSetMetadata::kNoPrimary; -#endif // _MSC_EXTENSIONS ReplSetMetadata::ReplSetMetadata(long long term, OpTime committedOpTime, diff --git a/src/mongo/rpc/metadata/server_selection_metadata.cpp b/src/mongo/rpc/metadata/server_selection_metadata.cpp index edc8e98d369..56e82e0ae5a 100644 --- a/src/mongo/rpc/metadata/server_selection_metadata.cpp +++ b/src/mongo/rpc/metadata/server_selection_metadata.cpp @@ -336,16 +336,5 @@ bool ServerSelectionMetadata::canRunOnSecondary() const { (_readPreference && (_readPreference->pref != ReadPreference::PrimaryOnly)); } -#if defined(_MSC_VER) && _MSC_VER < 1900 -ServerSelectionMetadata::ServerSelectionMetadata(ServerSelectionMetadata&& ssm) - : _secondaryOk(ssm._secondaryOk), _readPreference(std::move(ssm._readPreference)) {} - -ServerSelectionMetadata& ServerSelectionMetadata::operator=(ServerSelectionMetadata&& ssm) { - _secondaryOk = ssm._secondaryOk; - _readPreference = std::move(ssm._readPreference); - return *this; -} -#endif - } // rpc } // mongo diff --git a/src/mongo/rpc/metadata/server_selection_metadata.h b/src/mongo/rpc/metadata/server_selection_metadata.h index 65de1909f03..e79973466ad 100644 --- a/src/mongo/rpc/metadata/server_selection_metadata.h +++ b/src/mongo/rpc/metadata/server_selection_metadata.h @@ -55,15 +55,9 @@ public: ServerSelectionMetadata() = default; -#if defined(_MSC_VER) && _MSC_VER < 1900 - ServerSelectionMetadata(ServerSelectionMetadata&&); - - ServerSelectionMetadata& operator=(ServerSelectionMetadata&&); -#else ServerSelectionMetadata(ServerSelectionMetadata&&) = default; ServerSelectionMetadata& operator=(ServerSelectionMetadata&&) = default; -#endif /** * Loads ServerSelectionMetadata from a metadata object. diff --git a/src/mongo/rpc/unique_message.h b/src/mongo/rpc/unique_message.h index 6b470b3f9dd..2d5dba0da10 100644 --- a/src/mongo/rpc/unique_message.h +++ b/src/mongo/rpc/unique_message.h @@ -51,19 +51,8 @@ public: UniqueMessage(Message&& message, std::unique_ptr<MessageViewType> view) : _message{std::move(message)}, _view{std::move(view)} {} -#if defined(_MSC_VER) && _MSC_VER < 1900 - UniqueMessage(UniqueMessage&& other) - : _message{std::move(other._message)}, _view{std::move(other._view)} {} - - UniqueMessage& operator=(UniqueMessage&& other) { - _message = std::move(other._message); - _view = std::move(other._view); - return *this; - } -#else UniqueMessage(UniqueMessage&&) = default; UniqueMessage& operator=(UniqueMessage&&) = default; -#endif const MessageViewType* operator->() const { return _view.get(); diff --git a/src/mongo/s/query/cluster_client_cursor_impl.cpp b/src/mongo/s/query/cluster_client_cursor_impl.cpp index a80562042dc..c40dafa91ee 100644 --- a/src/mongo/s/query/cluster_client_cursor_impl.cpp +++ b/src/mongo/s/query/cluster_client_cursor_impl.cpp @@ -50,16 +50,6 @@ ClusterClientCursorGuard::~ClusterClientCursorGuard() { } } -#if defined(_MSC_VER) && _MSC_VER < 1900 -ClusterClientCursorGuard::ClusterClientCursorGuard(ClusterClientCursorGuard&& other) - : _ccc(std::move(other._ccc)) {} - -ClusterClientCursorGuard& ClusterClientCursorGuard::operator=(ClusterClientCursorGuard&& other) { - _ccc = std::move(other._ccc); - return *this; -} -#endif - ClusterClientCursor* ClusterClientCursorGuard::operator->() { return _ccc.get(); } diff --git a/src/mongo/s/query/cluster_client_cursor_impl.h b/src/mongo/s/query/cluster_client_cursor_impl.h index 1a8766f9005..b16dae9f9d3 100644 --- a/src/mongo/s/query/cluster_client_cursor_impl.h +++ b/src/mongo/s/query/cluster_client_cursor_impl.h @@ -59,13 +59,8 @@ public: */ ~ClusterClientCursorGuard(); -#if defined(_MSC_VER) && _MSC_VER < 1900 - ClusterClientCursorGuard(ClusterClientCursorGuard&&); - ClusterClientCursorGuard& operator=(ClusterClientCursorGuard&&); -#else ClusterClientCursorGuard(ClusterClientCursorGuard&&) = default; ClusterClientCursorGuard& operator=(ClusterClientCursorGuard&&) = default; -#endif /** * Returns a pointer to the underlying cursor. diff --git a/src/mongo/s/query/cluster_cursor_manager.cpp b/src/mongo/s/query/cluster_cursor_manager.cpp index e8883f3b9b0..22a3e3bd20e 100644 --- a/src/mongo/s/query/cluster_cursor_manager.cpp +++ b/src/mongo/s/query/cluster_cursor_manager.cpp @@ -98,11 +98,6 @@ ClusterCursorManager::PinnedCursor::PinnedCursor(PinnedCursor&& other) ClusterCursorManager::PinnedCursor& ClusterCursorManager::PinnedCursor::operator=( ClusterCursorManager::PinnedCursor&& other) { -#if defined(_MSC_VER) && _MSC_VER < 1900 // MSVC 2013 STL can emit self-move-assign. - if (&other == this) - return *this; -#endif - if (_cursor) { // The underlying cursor has not yet been returned. returnAndKillCursor(); diff --git a/src/mongo/s/query/cluster_cursor_manager.h b/src/mongo/s/query/cluster_cursor_manager.h index 2c2b6ff80e8..0561163b26b 100644 --- a/src/mongo/s/query/cluster_cursor_manager.h +++ b/src/mongo/s/query/cluster_cursor_manager.h @@ -403,26 +403,8 @@ private: invariant(_cursor); } -#if defined(_MSC_VER) && _MSC_VER < 1900 - CursorEntry(CursorEntry&& other) - : _cursor(std::move(other._cursor)), - _killPending(std::move(other._killPending)), - _cursorType(std::move(other._cursorType)), - _cursorLifetime(std::move(other._cursorLifetime)), - _lastActive(std::move(other._lastActive)) {} - - CursorEntry& operator=(CursorEntry&& other) { - _cursor = std::move(other._cursor); - _killPending = std::move(other._killPending); - _cursorType = std::move(other._cursorType); - _cursorLifetime = std::move(other._cursorLifetime); - _lastActive = std::move(other._lastActive); - return *this; - } -#else CursorEntry(CursorEntry&& other) = default; CursorEntry& operator=(CursorEntry&& other) = default; -#endif bool getKillPending() const { return _killPending; @@ -486,20 +468,8 @@ private: CursorEntryContainer(uint32_t containerPrefix) : containerPrefix(containerPrefix) {} -#if defined(_MSC_VER) && _MSC_VER < 1900 - CursorEntryContainer(CursorEntryContainer&& other) - : containerPrefix(std::move(other.containerPrefix)), - entryMap(std::move(other.entryMap)) {} - - CursorEntryContainer& operator=(CursorEntryContainer&& other) { - containerPrefix = std::move(other.containerPrefix); - entryMap = std::move(other.entryMap); - return *this; - } -#else CursorEntryContainer(CursorEntryContainer&& other) = default; CursorEntryContainer& operator=(CursorEntryContainer&& other) = default; -#endif // Common cursor id prefix for all cursors in this container. uint32_t containerPrefix; diff --git a/src/mongo/scripting/mozjs/jsstringwrapper.cpp b/src/mongo/scripting/mozjs/jsstringwrapper.cpp index efc72041f85..2732c98607b 100644 --- a/src/mongo/scripting/mozjs/jsstringwrapper.cpp +++ b/src/mongo/scripting/mozjs/jsstringwrapper.cpp @@ -72,20 +72,6 @@ JSStringWrapper::JSStringWrapper(JSContext* cx, JSString* str) : _isSet(true) { out[_length] = '\0'; } -#if defined(_MSC_VER) && _MSC_VER < 1900 -JSStringWrapper::JSStringWrapper(JSStringWrapper&& other) { - *this = std::move(other); -} - -JSStringWrapper& JSStringWrapper::operator=(JSStringWrapper&& other) { - _str = std::move(other._str); - _length = other._length; - std::memcpy(_buf, other._buf, sizeof(_buf)); - _isSet = other._isSet; - return *this; -} -#endif - StringData JSStringWrapper::toStringData() const { invariant(_isSet); return StringData(_str ? _str.get() : _buf, _length); diff --git a/src/mongo/scripting/mozjs/jsstringwrapper.h b/src/mongo/scripting/mozjs/jsstringwrapper.h index a0c5a85254e..33ed0e19227 100644 --- a/src/mongo/scripting/mozjs/jsstringwrapper.h +++ b/src/mongo/scripting/mozjs/jsstringwrapper.h @@ -48,15 +48,9 @@ public: JSStringWrapper(JSContext* cx, JSString* str); JSStringWrapper(std::int32_t val); -#if defined(_MSC_VER) && _MSC_VER < 1900 - JSStringWrapper(JSStringWrapper&&); - - JSStringWrapper& operator=(JSStringWrapper&&); -#else JSStringWrapper(JSStringWrapper&&) = default; JSStringWrapper& operator=(JSStringWrapper&&) = default; -#endif StringData toStringData() const; std::string toString() const; diff --git a/src/mongo/scripting/mozjs/objectwrapper.cpp b/src/mongo/scripting/mozjs/objectwrapper.cpp index 6f26833573d..a08f0efeefc 100644 --- a/src/mongo/scripting/mozjs/objectwrapper.cpp +++ b/src/mongo/scripting/mozjs/objectwrapper.cpp @@ -43,9 +43,7 @@ namespace mongo { namespace mozjs { -#ifndef _MSC_EXTENSIONS const int ObjectWrapper::kMaxWriteFieldDepth; -#endif // _MSC_EXTENSIONS void ObjectWrapper::Key::get(JSContext* cx, JS::HandleObject o, JS::MutableHandleValue value) { switch (_type) { diff --git a/src/mongo/shell/linenoise.cpp b/src/mongo/shell/linenoise.cpp index 641a4389e2d..03ca8bbf12f 100644 --- a/src/mongo/shell/linenoise.cpp +++ b/src/mongo/shell/linenoise.cpp @@ -88,9 +88,6 @@ #include <conio.h> #include <windows.h> #include <io.h> -#if _MSC_VER < 1900 -#define snprintf _snprintf // Microsoft headers use underscores in some names -#endif #define strcasecmp _stricmp #define strdup _strdup #define isatty _isatty diff --git a/src/mongo/shell/linenoise_utf8.h b/src/mongo/shell/linenoise_utf8.h index aab3e6f73f2..a1876d95a43 100644 --- a/src/mongo/shell/linenoise_utf8.h +++ b/src/mongo/shell/linenoise_utf8.h @@ -31,10 +31,6 @@ #include <memory> #include <string.h> -#if defined(_MSC_VER) && _MSC_VER < 1900 -#include <string> -#endif - namespace linenoise_utf8 { typedef unsigned char UChar8; // UTF-8 octet diff --git a/src/mongo/stdx/mutex.h b/src/mongo/stdx/mutex.h index dee03c3c0fe..91ce36d8a35 100644 --- a/src/mongo/stdx/mutex.h +++ b/src/mongo/stdx/mutex.h @@ -49,17 +49,9 @@ using ::std::try_to_lock_t; // NOLINT using ::std::lock_guard; // NOLINT using ::std::unique_lock; // NOLINT -#if _MSC_VER < 1900 -#define MONGO_STDX_CONSTEXPR const -#else -#define MONGO_STDX_CONSTEXPR constexpr -#endif - -MONGO_STDX_CONSTEXPR adopt_lock_t adopt_lock{}; -MONGO_STDX_CONSTEXPR defer_lock_t defer_lock{}; -MONGO_STDX_CONSTEXPR try_to_lock_t try_to_lock{}; - -#undef MONGO_STDX_CONSTEXPR +constexpr adopt_lock_t adopt_lock{}; +constexpr defer_lock_t defer_lock{}; +constexpr try_to_lock_t try_to_lock{}; } // namespace stdx } // namespace mongo diff --git a/src/mongo/util/decoration_registry.h b/src/mongo/util/decoration_registry.h index 47543cd23a2..5d04925c3db 100644 --- a/src/mongo/util/decoration_registry.h +++ b/src/mongo/util/decoration_registry.h @@ -59,10 +59,8 @@ public: */ template <typename T> DecorationContainer::DecorationDescriptorWithType<T> declareDecoration() { -#if !defined(_MSC_VER) || (_MSC_VER > 1800) // Try again with MSVC 2015 static_assert(std::is_nothrow_destructible<T>::value, "Decorations must be nothrow destructible"); -#endif return DecorationContainer::DecorationDescriptorWithType<T>(std::move(declareDecoration( sizeof(T), std::alignment_of<T>::value, &constructAt<T>, &destructAt<T>))); } diff --git a/src/mongo/util/shared_buffer.h b/src/mongo/util/shared_buffer.h index bd880e62e7c..6cb8103ded4 100644 --- a/src/mongo/util/shared_buffer.h +++ b/src/mongo/util/shared_buffer.h @@ -43,16 +43,6 @@ public: _holder.swap(other._holder); } -#if defined(_MSC_VER) && _MSC_VER < 1900 - SharedBuffer(const SharedBuffer&) = default; - SharedBuffer& operator=(const SharedBuffer&) = default; - SharedBuffer(SharedBuffer&& other) : _holder(std::move(other._holder)) {} - SharedBuffer& operator=(SharedBuffer&& other) { - _holder = std::move(other._holder); - return *this; - } -#endif - static SharedBuffer allocate(size_t bytes) { return takeOwnership(static_cast<char*>(mongoMalloc(sizeof(Holder) + bytes))); } diff --git a/src/mongo/util/time_support.cpp b/src/mongo/util/time_support.cpp index 33883d3fc30..f443db0f3b4 100644 --- a/src/mongo/util/time_support.cpp +++ b/src/mongo/util/time_support.cpp @@ -47,13 +47,6 @@ #include "mongo/util/concurrency/mutex.h" #include "mongo/util/system_tick_source.h" #include "mongo/util/timer.h" - -// NOTE(schwerin): MSVC's _snprintf is not a drop-in replacement for C99's snprintf(). In -// particular, when the target buffer is too small, behaviors differ. Consult the documentation -// from MSDN and form the BSD or Linux man pages before using. -#if _MSC_VER < 1900 -#define snprintf _snprintf -#endif #endif #ifdef __sun |