summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuildscripts/cpplint.py4
-rw-r--r--src/mongo/base/secure_allocator.cpp4
-rw-r--r--src/mongo/base/string_data_comparator_interface.h9
-rw-r--r--src/mongo/bson/bson_comparator_interface_base.h8
-rw-r--r--src/mongo/client/dbclient_rs_test.cpp4
-rw-r--r--src/mongo/db/auth/authorization_manager_test.cpp6
-rw-r--r--src/mongo/db/auth/role_name.h2
-rw-r--r--src/mongo/db/auth/user_name_hash.h2
-rw-r--r--src/mongo/db/commands.cpp32
-rw-r--r--src/mongo/db/commands/index_filter_commands.cpp4
-rw-r--r--src/mongo/db/exec/working_set.h4
-rw-r--r--src/mongo/db/matcher/expression_leaf.cpp3
-rw-r--r--src/mongo/db/matcher/expression_leaf.h5
-rw-r--r--src/mongo/db/matcher/expression_parser.cpp2
-rw-r--r--src/mongo/db/pipeline/accumulator.h2
-rw-r--r--src/mongo/db/pipeline/document_source.h2
-rw-r--r--src/mongo/db/pipeline/expression.cpp2
-rw-r--r--src/mongo/db/pipeline/parsed_aggregation_projection.cpp2
-rw-r--r--src/mongo/db/pipeline/parsed_exclusion_projection.h8
-rw-r--r--src/mongo/db/pipeline/parsed_inclusion_projection.h8
-rw-r--r--src/mongo/db/pipeline/value_comparator.h16
-rw-r--r--src/mongo/db/query/expression_index.cpp3
-rw-r--r--src/mongo/db/query/get_executor_test.cpp16
-rw-r--r--src/mongo/db/query/lru_key_value.h9
-rw-r--r--src/mongo/db/query/query_settings.cpp6
-rw-r--r--src/mongo/db/query/query_settings.h10
-rw-r--r--src/mongo/db/s/sharding_state.h4
-rw-r--r--src/mongo/db/views/durable_view_catalog.cpp2
-rw-r--r--src/mongo/db/views/view_graph.h12
-rw-r--r--src/mongo/dbtests/query_stage_keep.cpp2
-rw-r--r--src/mongo/executor/async_mock_stream_factory.h4
-rw-r--r--src/mongo/executor/async_timer_mock.cpp2
-rw-r--r--src/mongo/executor/async_timer_mock.h4
-rw-r--r--src/mongo/executor/connection_pool.cpp2
-rw-r--r--src/mongo/executor/connection_pool.h4
-rw-r--r--src/mongo/executor/connection_pool_stats.h5
-rw-r--r--src/mongo/executor/network_interface_asio.h8
-rw-r--r--src/mongo/executor/network_interface_mock.h8
-rw-r--r--src/mongo/executor/task_executor.h8
-rw-r--r--src/mongo/platform/hash_namespace.h13
-rw-r--r--src/mongo/platform/unordered_map.h4
-rw-r--r--src/mongo/platform/unordered_set.h4
-rw-r--r--src/mongo/s/balancer/migration_manager.h4
-rw-r--r--src/mongo/s/catalog/replset/replset_dist_lock_manager.h4
-rw-r--r--src/mongo/s/chunk_manager_tests.cpp2
-rw-r--r--src/mongo/s/client/shard_registry.h6
-rw-r--r--src/mongo/s/query/cluster_cursor_manager.h8
-rw-r--r--src/mongo/scripting/deadline_monitor.h2
-rw-r--r--src/mongo/scripting/mozjs/countdownlatch.cpp5
-rw-r--r--src/mongo/scripting/mozjs/engine.h4
-rw-r--r--src/mongo/shell/shell_utils_launcher.h4
-rw-r--r--src/mongo/stdx/unordered_map.h47
-rw-r--r--src/mongo/stdx/unordered_set.h47
-rw-r--r--src/mongo/tools/bridge_commands.h5
-rw-r--r--src/mongo/transport/service_entry_point_test_suite.cpp8
-rw-r--r--src/mongo/transport/transport_layer_legacy.h5
-rw-r--r--src/mongo/transport/transport_layer_mock.h5
-rw-r--r--src/mongo/util/net/ssl_manager.cpp10
-rw-r--r--src/mongo/util/net/ssl_types.h6
-rw-r--r--src/mongo/util/perfctr_collect.h6
-rw-r--r--src/third_party/s2/hash.h14
61 files changed, 275 insertions, 176 deletions
diff --git a/buildscripts/cpplint.py b/buildscripts/cpplint.py
index 94e7eda6a01..c8ab889c164 100755
--- a/buildscripts/cpplint.py
+++ b/buildscripts/cpplint.py
@@ -1619,9 +1619,9 @@ def make_polyfill_regex():
'async',
'bind',
'chrono',
- 'cref',
'condition_variable',
'condition_variable_any',
+ 'cref',
'cv_status',
'defer_lock',
'function',
@@ -1644,6 +1644,8 @@ def make_polyfill_regex():
'timed_mutex',
'try_to_lock',
'unique_lock',
+ 'unordered_map',
+ 'unordered_set',
]
qualified_names = ['boost::' + name + "\\b" for name in polyfill_required_names]
diff --git a/src/mongo/base/secure_allocator.cpp b/src/mongo/base/secure_allocator.cpp
index 21ace49d972..8c551ad94ec 100644
--- a/src/mongo/base/secure_allocator.cpp
+++ b/src/mongo/base/secure_allocator.cpp
@@ -32,7 +32,6 @@
#include "mongo/base/secure_allocator.h"
#include <memory>
-#include <unordered_map>
#ifdef _WIN32
#include <windows.h>
@@ -46,6 +45,7 @@
#include "mongo/base/init.h"
#include "mongo/stdx/memory.h"
#include "mongo/stdx/mutex.h"
+#include "mongo/stdx/unordered_map.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/log.h"
#include "mongo/util/processinfo.h"
@@ -323,7 +323,7 @@ private:
// See secure_allocator_details::allocate for a more detailed comment on what these are used for
stdx::mutex allocatorMutex; // Protects the values below
-std::unordered_map<void*, std::shared_ptr<Allocation>> secureTable;
+stdx::unordered_map<void*, std::shared_ptr<Allocation>> secureTable;
std::shared_ptr<Allocation> lastAllocation = nullptr;
} // namespace
diff --git a/src/mongo/base/string_data_comparator_interface.h b/src/mongo/base/string_data_comparator_interface.h
index c5e730bc1c0..eaba877038a 100644
--- a/src/mongo/base/string_data_comparator_interface.h
+++ b/src/mongo/base/string_data_comparator_interface.h
@@ -28,10 +28,9 @@
#pragma once
-#include <unordered_map>
-#include <unordered_set>
-
#include "mongo/base/disallow_copying.h"
+#include "mongo/stdx/unordered_map.h"
+#include "mongo/stdx/unordered_set.h"
#include "string_data.h"
namespace mongo {
@@ -77,10 +76,10 @@ public:
const ComparatorInterface* _stringComparator;
};
- using StringDataUnorderedSet = std::unordered_set<StringData, Hasher, EqualTo>;
+ using StringDataUnorderedSet = stdx::unordered_set<StringData, Hasher, EqualTo>;
template <typename T>
- using StringDataUnorderedMap = std::unordered_map<StringData, T, Hasher, EqualTo>;
+ using StringDataUnorderedMap = stdx::unordered_map<StringData, T, Hasher, EqualTo>;
ComparatorInterface() = default;
diff --git a/src/mongo/bson/bson_comparator_interface_base.h b/src/mongo/bson/bson_comparator_interface_base.h
index eba3a9a36d7..461199f6431 100644
--- a/src/mongo/bson/bson_comparator_interface_base.h
+++ b/src/mongo/bson/bson_comparator_interface_base.h
@@ -31,10 +31,10 @@
#include <initializer_list>
#include <map>
#include <set>
-#include <unordered_map>
-#include <unordered_set>
#include "mongo/base/disallow_copying.h"
+#include "mongo/stdx/unordered_map.h"
+#include "mongo/stdx/unordered_set.h"
#include "mongo/util/assert_util.h"
namespace mongo {
@@ -117,13 +117,13 @@ public:
using Set = std::set<T, LessThan>;
- using UnorderedSet = std::unordered_set<T, Hasher, EqualTo>;
+ using UnorderedSet = stdx::unordered_set<T, Hasher, EqualTo>;
template <typename ValueType>
using Map = std::map<T, ValueType, LessThan>;
template <typename ValueType>
- using UnorderedMap = std::unordered_map<T, ValueType, Hasher, EqualTo>;
+ using UnorderedMap = stdx::unordered_map<T, ValueType, Hasher, EqualTo>;
virtual ~BSONComparatorInterfaceBase() = default;
diff --git a/src/mongo/client/dbclient_rs_test.cpp b/src/mongo/client/dbclient_rs_test.cpp
index b9500da611a..e101695cdc8 100644
--- a/src/mongo/client/dbclient_rs_test.cpp
+++ b/src/mongo/client/dbclient_rs_test.cpp
@@ -34,7 +34,6 @@
#include <map>
#include <memory>
#include <string>
-#include <unordered_set>
#include <vector>
#include "mongo/base/string_data.h"
@@ -46,6 +45,7 @@
#include "mongo/dbtests/mock/mock_conn_registry.h"
#include "mongo/dbtests/mock/mock_replica_set.h"
#include "mongo/rpc/metadata/server_selection_metadata.h"
+#include "mongo/stdx/unordered_set.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/assert_util.h"
@@ -106,7 +106,7 @@ void assertOneOfNodesSelected(MockReplicaSet* replSet,
// We need the command to be a "SecOk command"
auto res = replConn.runCommandWithMetadata(
"foo", "dbStats", makeMetadata(rp, tagSet, secondaryOk), BSON("dbStats" << 1));
- std::unordered_set<HostAndPort> hostSet;
+ stdx::unordered_set<HostAndPort> hostSet;
for (const auto& hostName : hostNames) {
hostSet.emplace(hostName);
}
diff --git a/src/mongo/db/auth/authorization_manager_test.cpp b/src/mongo/db/auth/authorization_manager_test.cpp
index 50fc08e63dd..9e9312d0694 100644
--- a/src/mongo/db/auth/authorization_manager_test.cpp
+++ b/src/mongo/db/auth/authorization_manager_test.cpp
@@ -256,10 +256,10 @@ TEST_F(AuthorizationManagerTest, testLocalX509Authorization) {
authzManager->acquireUser(txn.get(), UserName("CN=mongodb.com", "$external"), &x509User));
ASSERT(x509User->isValid());
- std::unordered_set<RoleName> expectedRoles{RoleName("read", "test"),
- RoleName("readWrite", "test")};
+ stdx::unordered_set<RoleName> expectedRoles{RoleName("read", "test"),
+ RoleName("readWrite", "test")};
RoleNameIterator roles = x509User->getRoles();
- std::unordered_set<RoleName> acquiredRoles;
+ stdx::unordered_set<RoleName> acquiredRoles;
while (roles.more()) {
acquiredRoles.insert(roles.next());
}
diff --git a/src/mongo/db/auth/role_name.h b/src/mongo/db/auth/role_name.h
index 7606b216c02..5d9981cf9dc 100644
--- a/src/mongo/db/auth/role_name.h
+++ b/src/mongo/db/auth/role_name.h
@@ -164,7 +164,7 @@ private:
} // namespace mongo
-// Define hash function for RoleNames so they can be keys in std::unordered_map
+// Define hash function for RoleNames so they can be keys in stdx::unordered_map
MONGO_HASH_NAMESPACE_START
template <>
struct hash<mongo::RoleName> {
diff --git a/src/mongo/db/auth/user_name_hash.h b/src/mongo/db/auth/user_name_hash.h
index 6f38d9ccfda..f4759bf7ad6 100644
--- a/src/mongo/db/auth/user_name_hash.h
+++ b/src/mongo/db/auth/user_name_hash.h
@@ -33,7 +33,7 @@
#include "mongo/platform/hash_namespace.h"
-// Define hash function for UserNames so they can be keys in std::unordered_map
+// Define hash function for UserNames so they can be keys in stdx::unordered_map
MONGO_HASH_NAMESPACE_START
template <>
struct hash<mongo::UserName> {
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp
index bb7bee083ec..f7b526c1f2c 100644
--- a/src/mongo/db/commands.cpp
+++ b/src/mongo/db/commands.cpp
@@ -353,22 +353,22 @@ void Command::generateErrorResponse(OperationContext* txn,
}
namespace {
-const std::unordered_set<std::string> userManagementCommands{"createUser",
- "updateUser",
- "dropUser",
- "dropAllUsersFromDatabase",
- "grantRolesToUser",
- "revokeRolesFromUser",
- "createRole",
- "updateRole",
- "dropRole",
- "dropAllRolesFromDatabase",
- "grantPrivilegesToRole",
- "revokePrivilegesFromRole",
- "grantRolesToRole",
- "revokeRolesFromRole",
- "_mergeAuthzCollections",
- "authSchemaUpgrade"};
+const stdx::unordered_set<std::string> userManagementCommands{"createUser",
+ "updateUser",
+ "dropUser",
+ "dropAllUsersFromDatabase",
+ "grantRolesToUser",
+ "revokeRolesFromUser",
+ "createRole",
+ "updateRole",
+ "dropRole",
+ "dropAllRolesFromDatabase",
+ "grantPrivilegesToRole",
+ "revokePrivilegesFromRole",
+ "grantRolesToRole",
+ "revokeRolesFromRole",
+ "_mergeAuthzCollections",
+ "authSchemaUpgrade"};
} // namespace
bool Command::isUserManagementCommand(const std::string& name) {
diff --git a/src/mongo/db/commands/index_filter_commands.cpp b/src/mongo/db/commands/index_filter_commands.cpp
index ff315323a73..d9a5c5d900c 100644
--- a/src/mongo/db/commands/index_filter_commands.cpp
+++ b/src/mongo/db/commands/index_filter_commands.cpp
@@ -32,7 +32,6 @@
#include <sstream>
#include <string>
-#include <unordered_set>
#include <vector>
#include "mongo/base/init.h"
@@ -48,6 +47,7 @@
#include "mongo/db/jsobj.h"
#include "mongo/db/matcher/expression_parser.h"
#include "mongo/db/matcher/extensions_callback_real.h"
+#include "mongo/stdx/unordered_set.h"
#include "mongo/util/log.h"
@@ -366,7 +366,7 @@ Status SetFilter::set(OperationContext* txn,
"required field indexes must contain at least one index");
}
BSONObjSet indexes = SimpleBSONObjComparator::kInstance.makeBSONObjSet();
- std::unordered_set<std::string> indexNames;
+ stdx::unordered_set<std::string> indexNames;
for (vector<BSONElement>::const_iterator i = indexesEltArray.begin();
i != indexesEltArray.end();
++i) {
diff --git a/src/mongo/db/exec/working_set.h b/src/mongo/db/exec/working_set.h
index 8dab9943f3d..5fd9b6d93a2 100644
--- a/src/mongo/db/exec/working_set.h
+++ b/src/mongo/db/exec/working_set.h
@@ -28,7 +28,6 @@
#pragma once
-#include <unordered_set>
#include <vector>
#include "mongo/base/disallow_copying.h"
@@ -36,6 +35,7 @@
#include "mongo/db/record_id.h"
#include "mongo/db/storage/snapshot.h"
#include "mongo/platform/unordered_set.h"
+#include "mongo/stdx/unordered_set.h"
namespace mongo {
@@ -161,7 +161,7 @@ private:
WorkingSetID _freeList;
// An insert-only set of WorkingSetIDs that have been flagged for review.
- std::unordered_set<WorkingSetID> _flagged;
+ stdx::unordered_set<WorkingSetID> _flagged;
// Contains ids of WSMs that may need to be adjusted when we next yield.
std::vector<WorkingSetID> _yieldSensitiveIds;
diff --git a/src/mongo/db/matcher/expression_leaf.cpp b/src/mongo/db/matcher/expression_leaf.cpp
index 6ca2d815bc8..90b0cc985dc 100644
--- a/src/mongo/db/matcher/expression_leaf.cpp
+++ b/src/mongo/db/matcher/expression_leaf.cpp
@@ -32,7 +32,6 @@
#include <cmath>
#include <pcrecpp.h>
-#include <unordered_map>
#include "mongo/bson/bsonelement_comparator.h"
#include "mongo/bson/bsonmisc.h"
@@ -406,7 +405,7 @@ bool ExistsMatchExpression::equivalent(const MatchExpression* other) const {
const std::string TypeMatchExpression::kMatchesAllNumbersAlias = "number";
-const std::unordered_map<std::string, BSONType> TypeMatchExpression::typeAliasMap = {
+const stdx::unordered_map<std::string, BSONType> TypeMatchExpression::typeAliasMap = {
{typeName(NumberDouble), NumberDouble},
{typeName(String), String},
{typeName(Object), Object},
diff --git a/src/mongo/db/matcher/expression_leaf.h b/src/mongo/db/matcher/expression_leaf.h
index 62a45c81e9c..26568b20b81 100644
--- a/src/mongo/db/matcher/expression_leaf.h
+++ b/src/mongo/db/matcher/expression_leaf.h
@@ -30,12 +30,11 @@
#pragma once
-#include <unordered_map>
-
#include "mongo/bson/bsonmisc.h"
#include "mongo/bson/bsonobj.h"
#include "mongo/db/matcher/expression.h"
#include "mongo/stdx/memory.h"
+#include "mongo/stdx/unordered_map.h"
namespace pcrecpp {
class RE;
@@ -405,7 +404,7 @@ private:
class TypeMatchExpression : public MatchExpression {
public:
static const std::string kMatchesAllNumbersAlias;
- static const std::unordered_map<std::string, BSONType> typeAliasMap;
+ static const stdx::unordered_map<std::string, BSONType> typeAliasMap;
TypeMatchExpression() : MatchExpression(TYPE_OPERATOR) {}
diff --git a/src/mongo/db/matcher/expression_parser.cpp b/src/mongo/db/matcher/expression_parser.cpp
index 4c9a49c26aa..8aba94b60fe 100644
--- a/src/mongo/db/matcher/expression_parser.cpp
+++ b/src/mongo/db/matcher/expression_parser.cpp
@@ -661,7 +661,7 @@ StatusWithMatchExpression MatchExpressionParser::_parseType(const char* name,
}
// Search the string-int map for the typeAlias (case-sensitive).
- std::unordered_map<std::string, BSONType>::const_iterator it =
+ stdx::unordered_map<std::string, BSONType>::const_iterator it =
TypeMatchExpression::typeAliasMap.find(typeAlias);
if (it == TypeMatchExpression::typeAliasMap.end()) {
std::stringstream ss;
diff --git a/src/mongo/db/pipeline/accumulator.h b/src/mongo/db/pipeline/accumulator.h
index fa1847fc5ef..e0a2dbdb11a 100644
--- a/src/mongo/db/pipeline/accumulator.h
+++ b/src/mongo/db/pipeline/accumulator.h
@@ -32,7 +32,6 @@
#include <boost/intrusive_ptr.hpp>
#include <boost/optional.hpp>
-#include <unordered_set>
#include <vector>
#include "mongo/base/init.h"
@@ -42,6 +41,7 @@
#include "mongo/db/pipeline/value.h"
#include "mongo/db/pipeline/value_comparator.h"
#include "mongo/stdx/functional.h"
+#include "mongo/stdx/unordered_set.h"
#include "mongo/util/summation.h"
namespace mongo {
diff --git a/src/mongo/db/pipeline/document_source.h b/src/mongo/db/pipeline/document_source.h
index 8599bace9ac..49801200e4b 100644
--- a/src/mongo/db/pipeline/document_source.h
+++ b/src/mongo/db/pipeline/document_source.h
@@ -34,7 +34,6 @@
#include <deque>
#include <list>
#include <string>
-#include <unordered_map>
#include <utility>
#include <vector>
@@ -59,6 +58,7 @@
#include "mongo/db/query/plan_summary_stats.h"
#include "mongo/db/sorter/sorter.h"
#include "mongo/stdx/functional.h"
+#include "mongo/stdx/unordered_map.h"
#include "mongo/util/intrusive_counter.h"
namespace mongo {
diff --git a/src/mongo/db/pipeline/expression.cpp b/src/mongo/db/pipeline/expression.cpp
index 1f7e363df8d..4f4c893fd17 100644
--- a/src/mongo/db/pipeline/expression.cpp
+++ b/src/mongo/db/pipeline/expression.cpp
@@ -1200,7 +1200,7 @@ intrusive_ptr<ExpressionObject> ExpressionObject::create(
intrusive_ptr<ExpressionObject> ExpressionObject::parse(BSONObj obj,
const VariablesParseState& vps) {
// Make sure we don't have any duplicate field names.
- std::unordered_set<string> specifiedFields;
+ stdx::unordered_set<string> specifiedFields;
vector<pair<string, intrusive_ptr<Expression>>> expressions;
for (auto&& elem : obj) {
diff --git a/src/mongo/db/pipeline/parsed_aggregation_projection.cpp b/src/mongo/db/pipeline/parsed_aggregation_projection.cpp
index c0a53c8a23b..a73a9589ed8 100644
--- a/src/mongo/db/pipeline/parsed_aggregation_projection.cpp
+++ b/src/mongo/db/pipeline/parsed_aggregation_projection.cpp
@@ -32,7 +32,6 @@
#include <boost/optional.hpp>
#include <string>
-#include <unordered_set>
#include "mongo/bson/bsonelement.h"
#include "mongo/bson/bsonobj.h"
@@ -40,6 +39,7 @@
#include "mongo/db/pipeline/field_path.h"
#include "mongo/db/pipeline/parsed_exclusion_projection.h"
#include "mongo/db/pipeline/parsed_inclusion_projection.h"
+#include "mongo/stdx/unordered_set.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/mongoutils/str.h"
diff --git a/src/mongo/db/pipeline/parsed_exclusion_projection.h b/src/mongo/db/pipeline/parsed_exclusion_projection.h
index c51ccd754cf..18fb7dc1a60 100644
--- a/src/mongo/db/pipeline/parsed_exclusion_projection.h
+++ b/src/mongo/db/pipeline/parsed_exclusion_projection.h
@@ -30,10 +30,10 @@
#include <memory>
#include <string>
-#include <unordered_map>
-#include <unordered_set>
#include "mongo/db/pipeline/parsed_aggregation_projection.h"
+#include "mongo/stdx/unordered_map.h"
+#include "mongo/stdx/unordered_set.h"
namespace mongo {
@@ -81,10 +81,10 @@ private:
Value applyProjectionToValue(Value val) const;
// Fields excluded at this level.
- std::unordered_set<std::string> _excludedFields;
+ stdx::unordered_set<std::string> _excludedFields;
std::string _pathToNode;
- std::unordered_map<std::string, std::unique_ptr<ExclusionNode>> _children;
+ stdx::unordered_map<std::string, std::unique_ptr<ExclusionNode>> _children;
};
/**
diff --git a/src/mongo/db/pipeline/parsed_inclusion_projection.h b/src/mongo/db/pipeline/parsed_inclusion_projection.h
index e72e334f837..eb2bc1877bc 100644
--- a/src/mongo/db/pipeline/parsed_inclusion_projection.h
+++ b/src/mongo/db/pipeline/parsed_inclusion_projection.h
@@ -29,13 +29,13 @@
#pragma once
#include <memory>
-#include <unordered_map>
-#include <unordered_set>
#include "mongo/db/pipeline/expression.h"
#include "mongo/db/pipeline/expression_context.h"
#include "mongo/db/pipeline/parsed_aggregation_projection.h"
#include "mongo/stdx/memory.h"
+#include "mongo/stdx/unordered_map.h"
+#include "mongo/stdx/unordered_set.h"
namespace mongo {
@@ -155,10 +155,10 @@ private:
std::vector<std::string> _orderToProcessAdditionsAndChildren;
StringMap<boost::intrusive_ptr<Expression>> _expressions;
- std::unordered_set<std::string> _inclusions;
+ stdx::unordered_set<std::string> _inclusions;
// TODO use StringMap once SERVER-23700 is resolved.
- std::unordered_map<std::string, std::unique_ptr<InclusionNode>> _children;
+ stdx::unordered_map<std::string, std::unique_ptr<InclusionNode>> _children;
};
/**
diff --git a/src/mongo/db/pipeline/value_comparator.h b/src/mongo/db/pipeline/value_comparator.h
index 1e46da52ce9..420ec4c5ae4 100644
--- a/src/mongo/db/pipeline/value_comparator.h
+++ b/src/mongo/db/pipeline/value_comparator.h
@@ -30,11 +30,11 @@
#include <map>
#include <set>
-#include <unordered_map>
-#include <unordered_set>
#include "mongo/base/string_data.h"
#include "mongo/db/pipeline/value.h"
+#include "mongo/stdx/unordered_map.h"
+#include "mongo/stdx/unordered_set.h"
namespace mongo {
@@ -160,8 +160,8 @@ public:
* Construct an empty unordered set of Value whose equivalence classes are given by this
* comparator. This comparator must outlive the returned set.
*/
- std::unordered_set<Value, Hasher, EqualTo> makeUnorderedValueSet() const {
- return std::unordered_set<Value, Hasher, EqualTo>(0, Hasher(this), EqualTo(this));
+ stdx::unordered_set<Value, Hasher, EqualTo> makeUnorderedValueSet() const {
+ return stdx::unordered_set<Value, Hasher, EqualTo>(0, Hasher(this), EqualTo(this));
}
/**
@@ -178,8 +178,8 @@ public:
* this comparator. This comparator must outlive the returned set.
*/
template <typename T>
- std::unordered_map<Value, T, Hasher, EqualTo> makeUnorderedValueMap() const {
- return std::unordered_map<Value, T, Hasher, EqualTo>(0, Hasher(this), EqualTo(this));
+ stdx::unordered_map<Value, T, Hasher, EqualTo> makeUnorderedValueMap() const {
+ return stdx::unordered_map<Value, T, Hasher, EqualTo>(0, Hasher(this), EqualTo(this));
}
private:
@@ -193,13 +193,13 @@ private:
using ValueSet = std::set<Value, ValueComparator::LessThan>;
using ValueUnorderedSet =
- std::unordered_set<Value, ValueComparator::Hasher, ValueComparator::EqualTo>;
+ stdx::unordered_set<Value, ValueComparator::Hasher, ValueComparator::EqualTo>;
template <typename T>
using ValueMap = std::map<Value, T, ValueComparator::LessThan>;
template <typename T>
using ValueUnorderedMap =
- std::unordered_map<Value, T, ValueComparator::Hasher, ValueComparator::EqualTo>;
+ stdx::unordered_map<Value, T, ValueComparator::Hasher, ValueComparator::EqualTo>;
} // namespace mongo
diff --git a/src/mongo/db/query/expression_index.cpp b/src/mongo/db/query/expression_index.cpp
index ff24396baeb..45617f35a89 100644
--- a/src/mongo/db/query/expression_index.cpp
+++ b/src/mongo/db/query/expression_index.cpp
@@ -29,6 +29,7 @@
#include "mongo/db/query/expression_index.h"
#include <iostream>
+#include <unordered_set>
#include "mongo/db/geo/geoconstants.h"
#include "mongo/db/geo/r2_region_coverer.h"
@@ -186,7 +187,7 @@ void ExpressionMapping::S2CellIdsToIntervalsWithParents(const std::vector<S2Cell
const S2IndexingParams& indexParams,
OrderedIntervalList* oilOut) {
// There may be duplicates when going up parent cells if two cells share a parent
- std::unordered_set<S2CellId> exactSet;
+ std::unordered_set<S2CellId> exactSet; // NOLINT
for (const S2CellId& interval : intervalSet) {
S2CellId coveredCell = interval;
// Look at the cells that cover us. We want to look at every cell that contains the
diff --git a/src/mongo/db/query/get_executor_test.cpp b/src/mongo/db/query/get_executor_test.cpp
index 1979a178872..a05c8e08e13 100644
--- a/src/mongo/db/query/get_executor_test.cpp
+++ b/src/mongo/db/query/get_executor_test.cpp
@@ -34,13 +34,13 @@
#include <boost/optional.hpp>
#include <string>
-#include <unordered_set>
#include "mongo/bson/simple_bsonobj_comparator.h"
#include "mongo/db/json.h"
#include "mongo/db/matcher/extensions_callback_disallow_extensions.h"
#include "mongo/db/query/query_settings.h"
#include "mongo/db/query/query_test_service_context.h"
+#include "mongo/stdx/unordered_set.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/mongoutils/str.h"
@@ -90,8 +90,8 @@ unique_ptr<CanonicalQuery> canonicalize(const char* queryStr,
*/
void testAllowedIndices(std::vector<IndexEntry> indexes,
BSONObjSet keyPatterns,
- std::unordered_set<std::string> indexNames,
- std::unordered_set<std::string> expectedFilteredNames) {
+ stdx::unordered_set<std::string> indexNames,
+ stdx::unordered_set<std::string> expectedFilteredNames) {
PlanCache planCache;
QuerySettings querySettings;
@@ -124,7 +124,7 @@ TEST(GetExecutorTest, GetAllowedIndices) {
IndexEntry(fromjson("{a: 1, b: 1}"), "a_1_b_1"),
IndexEntry(fromjson("{a: 1, c: 1}"), "a_1_c_1")},
SimpleBSONObjComparator::kInstance.makeBSONObjSet({fromjson("{a: 1, b: 1}")}),
- {},
+ stdx::unordered_set<std::string>{},
{"a_1_b_1"});
}
@@ -137,8 +137,8 @@ TEST(GetExecutorTest, GetAllowedIndicesNonExistentIndexKeyPatterns) {
IndexEntry(fromjson("{a: 1, b: 1}"), "a_1_b_1"),
IndexEntry(fromjson("{a: 1, c: 1}"), "a_1_c_1")},
SimpleBSONObjComparator::kInstance.makeBSONObjSet({fromjson("{nosuchfield: 1}")}),
- {},
- {});
+ stdx::unordered_set<std::string>{},
+ stdx::unordered_set<std::string>{});
}
// This test case shows how to force query execution to use
@@ -147,7 +147,7 @@ TEST(GetExecutorTest, GetAllowedIndicesDescendingOrder) {
testAllowedIndices(
{IndexEntry(fromjson("{a: 1}"), "a_1"), IndexEntry(fromjson("{a: -1}"), "a_-1")},
SimpleBSONObjComparator::kInstance.makeBSONObjSet({fromjson("{a: -1}")}),
- {},
+ stdx::unordered_set<std::string>{},
{"a_-1"});
}
@@ -165,7 +165,7 @@ TEST(GetExecutorTest, GetAllowedIndicesMatchesMultipleIndexesByKey) {
testAllowedIndices(
{IndexEntry(fromjson("{a: 1}"), "a_1"), IndexEntry(fromjson("{a: 1}"), "a_1:en")},
SimpleBSONObjComparator::kInstance.makeBSONObjSet({fromjson("{a: 1}")}),
- {},
+ stdx::unordered_set<std::string>{},
{"a_1", "a_1:en"});
}
diff --git a/src/mongo/db/query/lru_key_value.h b/src/mongo/db/query/lru_key_value.h
index ddf17faaef8..bb1918dfe12 100644
--- a/src/mongo/db/query/lru_key_value.h
+++ b/src/mongo/db/query/lru_key_value.h
@@ -30,9 +30,9 @@
#include <list>
#include <memory>
-#include <unordered_map>
#include "mongo/base/status.h"
+#include "mongo/stdx/unordered_map.h"
#include "mongo/util/assert_util.h"
namespace mongo {
@@ -47,9 +47,8 @@ namespace mongo {
* for protecting concurrent access to the LRU store if used in a threaded
* context.
*
- * Implemented as a doubly-linked list (std::list) with a hash map
- * (boost::unordered_map) for quickly locating the kv-store entries. The
- * add(), get(), and remove() operations are all O(1).
+ * Implemented as a doubly-linked list with a hash map for quickly locating the kv-store entries.
+ * The add(), get(), and remove() operations are all O(1).
*
* The keys of generic type K map to values of type V*. The V*
* pointers are owned by the kv-store.
@@ -72,7 +71,7 @@ public:
typedef typename KVList::iterator KVListIt;
typedef typename KVList::const_iterator KVListConstIt;
- typedef std::unordered_map<K, KVListIt> KVMap;
+ typedef stdx::unordered_map<K, KVListIt> KVMap;
typedef typename KVMap::const_iterator KVMapConstIt;
/**
diff --git a/src/mongo/db/query/query_settings.cpp b/src/mongo/db/query/query_settings.cpp
index b5b5aa95473..ba4d1e8d616 100644
--- a/src/mongo/db/query/query_settings.cpp
+++ b/src/mongo/db/query/query_settings.cpp
@@ -38,7 +38,7 @@ namespace mongo {
//
AllowedIndicesFilter::AllowedIndicesFilter(const BSONObjSet& indexKeyPatterns,
- const std::unordered_set<std::string>& indexNames)
+ const stdx::unordered_set<std::string>& indexNames)
: indexKeyPatterns(SimpleBSONObjComparator::kInstance.makeBSONObjSet()),
indexNames(indexNames) {
for (BSONObjSet::const_iterator i = indexKeyPatterns.begin(); i != indexKeyPatterns.end();
@@ -57,7 +57,7 @@ AllowedIndexEntry::AllowedIndexEntry(const BSONObj& query,
const BSONObj& projection,
const BSONObj& collation,
const BSONObjSet& indexKeyPatterns,
- const std::unordered_set<std::string>& indexNames)
+ const stdx::unordered_set<std::string>& indexNames)
: query(query.getOwned()),
sort(sort.getOwned()),
projection(projection.getOwned()),
@@ -100,7 +100,7 @@ std::vector<AllowedIndexEntry> QuerySettings::getAllAllowedIndices() const {
void QuerySettings::setAllowedIndices(const CanonicalQuery& canonicalQuery,
const PlanCacheKey& key,
const BSONObjSet& indexKeyPatterns,
- const std::unordered_set<std::string>& indexNames) {
+ const stdx::unordered_set<std::string>& indexNames) {
const QueryRequest& qr = canonicalQuery.getQueryRequest();
const BSONObj& query = qr.getFilter();
const BSONObj& sort = qr.getSort();
diff --git a/src/mongo/db/query/query_settings.h b/src/mongo/db/query/query_settings.h
index ec45629db31..15bd3082f19 100644
--- a/src/mongo/db/query/query_settings.h
+++ b/src/mongo/db/query/query_settings.h
@@ -51,7 +51,7 @@ private:
public:
AllowedIndicesFilter(const BSONObjSet& indexKeyPatterns,
- const std::unordered_set<std::string>& indexNames);
+ const stdx::unordered_set<std::string>& indexNames);
AllowedIndicesFilter(AllowedIndicesFilter&& other) = default;
AllowedIndicesFilter& operator=(AllowedIndicesFilter&& other) = default;
@@ -69,7 +69,7 @@ public:
// we will use to override the indexes retrieved from
// the index catalog.
BSONObjSet indexKeyPatterns;
- std::unordered_set<std::string> indexNames;
+ stdx::unordered_set<std::string> indexNames;
};
/**
@@ -85,7 +85,7 @@ public:
const BSONObj& projection,
const BSONObj& collation,
const BSONObjSet& indexKeyPatterns,
- const std::unordered_set<std::string>& indexNames);
+ const stdx::unordered_set<std::string>& indexNames);
// query, sort, projection, and collation collectively represent the query shape that we are
// storing hint overrides for.
@@ -98,7 +98,7 @@ public:
// we will use to override the indexes retrieved from
// the index catalog.
BSONObjSet indexKeyPatterns;
- std::unordered_set<std::string> indexNames;
+ stdx::unordered_set<std::string> indexNames;
};
/**
@@ -129,7 +129,7 @@ public:
void setAllowedIndices(const CanonicalQuery& canonicalQuery,
const PlanCacheKey& key,
const BSONObjSet& indexKeyPatterns,
- const std::unordered_set<std::string>& indexNames);
+ const stdx::unordered_set<std::string>& indexNames);
/**
* Removes single entry from query settings. No effect if query shape is not found.
diff --git a/src/mongo/db/s/sharding_state.h b/src/mongo/db/s/sharding_state.h
index 26fb65a7a58..d9acc7a7eb9 100644
--- a/src/mongo/db/s/sharding_state.h
+++ b/src/mongo/db/s/sharding_state.h
@@ -29,7 +29,6 @@
#pragma once
#include <string>
-#include <unordered_map>
#include <vector>
#include "mongo/base/disallow_copying.h"
@@ -43,6 +42,7 @@
#include "mongo/stdx/functional.h"
#include "mongo/stdx/memory.h"
#include "mongo/stdx/mutex.h"
+#include "mongo/stdx/unordered_map.h"
#include "mongo/util/concurrency/ticketholder.h"
#include "mongo/util/time_support.h"
@@ -276,7 +276,7 @@ private:
friend class ScopedRegisterMigration;
// Map from a namespace into the sharding state for each collection we have
- typedef std::unordered_map<std::string, std::unique_ptr<CollectionShardingState>>
+ typedef stdx::unordered_map<std::string, std::unique_ptr<CollectionShardingState>>
CollectionShardingStateMap;
// Progress of the sharding state initialization
diff --git a/src/mongo/db/views/durable_view_catalog.cpp b/src/mongo/db/views/durable_view_catalog.cpp
index dde1b922eef..1b597081d50 100644
--- a/src/mongo/db/views/durable_view_catalog.cpp
+++ b/src/mongo/db/views/durable_view_catalog.cpp
@@ -33,7 +33,6 @@
#include "mongo/db/views/durable_view_catalog.h"
#include <string>
-#include <unordered_set>
#include "mongo/db/catalog/collection.h"
#include "mongo/db/catalog/database.h"
@@ -42,6 +41,7 @@
#include "mongo/db/namespace_string.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/storage/record_data.h"
+#include "mongo/stdx/unordered_set.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/log.h"
#include "mongo/util/string_map.h"
diff --git a/src/mongo/db/views/view_graph.h b/src/mongo/db/views/view_graph.h
index 20214444d2c..65b192280ce 100644
--- a/src/mongo/db/views/view_graph.h
+++ b/src/mongo/db/views/view_graph.h
@@ -27,12 +27,12 @@
*/
#pragma once
-#include <unordered_map>
-#include <unordered_set>
#include <vector>
#include "mongo/base/status.h"
#include "mongo/db/namespace_string.h"
+#include "mongo/stdx/unordered_map.h"
+#include "mongo/stdx/unordered_set.h"
#include "mongo/util/string_map.h"
namespace mongo {
@@ -87,8 +87,8 @@ private:
struct Node {
// Note, a view may refer to the same child more than once, but we only need to know the
// set of children and parents, since we do not need to traverse duplicates.
- std::unordered_set<uint64_t> parents;
- std::unordered_set<uint64_t> children;
+ stdx::unordered_set<uint64_t> parents;
+ stdx::unordered_set<uint64_t> children;
std::string ns;
};
@@ -98,7 +98,7 @@ private:
int height = 0;
};
- using HeightMap = std::unordered_map<uint64_t, NodeHeight>;
+ using HeightMap = stdx::unordered_map<uint64_t, NodeHeight>;
/**
* Recursively traverses parents of this node and computes their heights. Returns an error
@@ -127,7 +127,7 @@ private:
// Maps node ids to nodes. There is a 1-1 correspondance with _namespaceIds, hence the lifetime
// of a node is the same as the lifetime as its corresponding node id.
- std::unordered_map<uint64_t, Node> _graph;
+ stdx::unordered_map<uint64_t, Node> _graph;
static uint64_t _idCounter;
};
} // namespace mongo
diff --git a/src/mongo/dbtests/query_stage_keep.cpp b/src/mongo/dbtests/query_stage_keep.cpp
index 56c8c1d7387..782cc0eaf91 100644
--- a/src/mongo/dbtests/query_stage_keep.cpp
+++ b/src/mongo/dbtests/query_stage_keep.cpp
@@ -217,7 +217,7 @@ public:
// This condition triggers SERVER-15580 (the new flagging causes a rehash of the
// unordered_set "WorkingSet::_flagged", which invalidates all iterators, which were
// previously being dereferenced in KeepMutationsStage::work()).
- // Note that std::unordered_set<>::insert() triggers a rehash if the new number of
+ // Note that stdx::unordered_set<>::insert() triggers a rehash if the new number of
// elements is greater than or equal to max_load_factor()*bucket_count().
size_t rehashSize =
static_cast<size_t>(ws.getFlagged().max_load_factor() * ws.getFlagged().bucket_count());
diff --git a/src/mongo/executor/async_mock_stream_factory.h b/src/mongo/executor/async_mock_stream_factory.h
index 0c1e33ad3b4..fe9000962b3 100644
--- a/src/mongo/executor/async_mock_stream_factory.h
+++ b/src/mongo/executor/async_mock_stream_factory.h
@@ -32,7 +32,6 @@
#include <cstdint>
#include <memory>
#include <queue>
-#include <unordered_map>
#include "mongo/executor/async_stream_factory_interface.h"
#include "mongo/executor/async_stream_interface.h"
@@ -42,6 +41,7 @@
#include "mongo/stdx/condition_variable.h"
#include "mongo/stdx/functional.h"
#include "mongo/stdx/mutex.h"
+#include "mongo/stdx/unordered_map.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/net/hostandport.h"
@@ -132,7 +132,7 @@ private:
stdx::mutex _factoryMutex;
stdx::condition_variable _factoryCv;
- std::unordered_map<HostAndPort, MockStream*> _streams;
+ stdx::unordered_map<HostAndPort, MockStream*> _streams;
};
template <int EventType>
diff --git a/src/mongo/executor/async_timer_mock.cpp b/src/mongo/executor/async_timer_mock.cpp
index 9807947dcf4..addfd4f7cd4 100644
--- a/src/mongo/executor/async_timer_mock.cpp
+++ b/src/mongo/executor/async_timer_mock.cpp
@@ -105,7 +105,7 @@ void AsyncTimerFactoryMock::fastForward(Milliseconds time) {
stdx::lock_guard<stdx::mutex> lk(_timersMutex);
// erase after iterating to be safe
- std::unordered_set<std::shared_ptr<AsyncTimerMockImpl>> expired;
+ stdx::unordered_set<std::shared_ptr<AsyncTimerMockImpl>> expired;
for (auto elem = _timers.begin(); elem != _timers.end(); elem++) {
auto timer = *elem;
diff --git a/src/mongo/executor/async_timer_mock.h b/src/mongo/executor/async_timer_mock.h
index 6c0e4c755f2..2d2eb2c4108 100644
--- a/src/mongo/executor/async_timer_mock.h
+++ b/src/mongo/executor/async_timer_mock.h
@@ -28,11 +28,11 @@
#pragma once
-#include <unordered_set>
#include <vector>
#include "mongo/executor/async_timer_interface.h"
#include "mongo/stdx/mutex.h"
+#include "mongo/stdx/unordered_set.h"
namespace mongo {
namespace executor {
@@ -129,7 +129,7 @@ public:
private:
stdx::mutex _timersMutex;
- std::unordered_set<std::shared_ptr<AsyncTimerMockImpl>> _timers;
+ stdx::unordered_set<std::shared_ptr<AsyncTimerMockImpl>> _timers;
};
} // namespace executor
diff --git a/src/mongo/executor/connection_pool.cpp b/src/mongo/executor/connection_pool.cpp
index 77e9f542af7..32b83d3348d 100644
--- a/src/mongo/executor/connection_pool.cpp
+++ b/src/mongo/executor/connection_pool.cpp
@@ -101,7 +101,7 @@ public:
private:
using OwnedConnection = std::unique_ptr<ConnectionInterface>;
- using OwnershipPool = std::unordered_map<ConnectionInterface*, OwnedConnection>;
+ using OwnershipPool = stdx::unordered_map<ConnectionInterface*, OwnedConnection>;
using Request = std::pair<Date_t, GetConnectionCallback>;
struct RequestComparator {
bool operator()(const Request& a, const Request& b) {
diff --git a/src/mongo/executor/connection_pool.h b/src/mongo/executor/connection_pool.h
index 68ea3ad4eba..80817130ce9 100644
--- a/src/mongo/executor/connection_pool.h
+++ b/src/mongo/executor/connection_pool.h
@@ -29,12 +29,12 @@
#include <memory>
#include <queue>
-#include <unordered_map>
#include "mongo/base/disallow_copying.h"
#include "mongo/stdx/chrono.h"
#include "mongo/stdx/functional.h"
#include "mongo/stdx/mutex.h"
+#include "mongo/stdx/unordered_map.h"
#include "mongo/util/net/hostandport.h"
#include "mongo/util/time_support.h"
@@ -131,7 +131,7 @@ private:
// The global mutex for specific pool access and the generation counter
mutable stdx::mutex _mutex;
- std::unordered_map<HostAndPort, std::unique_ptr<SpecificPool>> _pools;
+ stdx::unordered_map<HostAndPort, std::unique_ptr<SpecificPool>> _pools;
};
class ConnectionPool::ConnectionHandleDeleter {
diff --git a/src/mongo/executor/connection_pool_stats.h b/src/mongo/executor/connection_pool_stats.h
index 5e9bd0c7633..dfdfb71205c 100644
--- a/src/mongo/executor/connection_pool_stats.h
+++ b/src/mongo/executor/connection_pool_stats.h
@@ -28,8 +28,7 @@
#pragma once
-#include <unordered_map>
-
+#include "mongo/stdx/unordered_map.h"
#include "mongo/util/net/hostandport.h"
namespace mongo {
@@ -65,7 +64,7 @@ struct ConnectionPoolStats {
size_t totalAvailable = 0u;
size_t totalCreated = 0u;
- std::unordered_map<HostAndPort, ConnectionStatsPerHost> statsByHost;
+ stdx::unordered_map<HostAndPort, ConnectionStatsPerHost> statsByHost;
};
} // namespace executor
diff --git a/src/mongo/executor/network_interface_asio.h b/src/mongo/executor/network_interface_asio.h
index bfd9330c4fe..3d7aa2f1445 100644
--- a/src/mongo/executor/network_interface_asio.h
+++ b/src/mongo/executor/network_interface_asio.h
@@ -35,8 +35,6 @@
#include <memory>
#include <string>
#include <system_error>
-#include <unordered_map>
-#include <unordered_set>
#include <vector>
#include "mongo/base/status.h"
@@ -56,6 +54,8 @@
#include "mongo/stdx/functional.h"
#include "mongo/stdx/mutex.h"
#include "mongo/stdx/thread.h"
+#include "mongo/stdx/unordered_map.h"
+#include "mongo/stdx/unordered_set.h"
#include "mongo/transport/message_compressor_manager.h"
#include "mongo/util/net/message.h"
@@ -506,8 +506,8 @@ private:
// If it is necessary to hold this lock while accessing a particular operation with
// an AccessControl object, take this lock first, always.
stdx::mutex _inProgressMutex;
- std::unordered_map<AsyncOp*, std::unique_ptr<AsyncOp>> _inProgress;
- std::unordered_set<TaskExecutor::CallbackHandle> _inGetConnection;
+ stdx::unordered_map<AsyncOp*, std::unique_ptr<AsyncOp>> _inProgress;
+ stdx::unordered_set<TaskExecutor::CallbackHandle> _inGetConnection;
// Operation counters
AtomicUInt64 _numCanceledOps;
diff --git a/src/mongo/executor/network_interface_mock.h b/src/mongo/executor/network_interface_mock.h
index de4a224ac91..16d112fc14c 100644
--- a/src/mongo/executor/network_interface_mock.h
+++ b/src/mongo/executor/network_interface_mock.h
@@ -30,8 +30,6 @@
#include <memory>
#include <queue>
-#include <unordered_map>
-#include <unordered_set>
#include <utility>
#include <vector>
@@ -41,6 +39,8 @@
#include "mongo/stdx/condition_variable.h"
#include "mongo/stdx/list.h"
#include "mongo/stdx/mutex.h"
+#include "mongo/stdx/unordered_map.h"
+#include "mongo/stdx/unordered_set.h"
#include "mongo/util/time_support.h"
namespace mongo {
@@ -387,10 +387,10 @@ private:
// ConnectionHook's validation and post-connection logic.
//
// TODO: provide a way to simulate disconnections.
- std::unordered_set<HostAndPort> _connections; // (M)
+ stdx::unordered_set<HostAndPort> _connections; // (M)
// The handshake replies set for each host.
- std::unordered_map<HostAndPort, RemoteCommandResponse> _handshakeReplies; // (M)
+ stdx::unordered_map<HostAndPort, RemoteCommandResponse> _handshakeReplies; // (M)
};
/**
diff --git a/src/mongo/executor/task_executor.h b/src/mongo/executor/task_executor.h
index abf5d5d221a..96d52d794e4 100644
--- a/src/mongo/executor/task_executor.h
+++ b/src/mongo/executor/task_executor.h
@@ -38,6 +38,7 @@
#include "mongo/base/string_data.h"
#include "mongo/executor/remote_command_request.h"
#include "mongo/executor/remote_command_response.h"
+#include "mongo/platform/hash_namespace.h"
#include "mongo/stdx/functional.h"
#include "mongo/util/time_support.h"
@@ -415,13 +416,12 @@ struct TaskExecutor::RemoteCommandCallbackArgs {
} // namespace executor
} // namespace mongo
-// Provide a specialization for std::hash<CallbackHandle> so it can easily
-// be stored in unordered_set.
-namespace std {
+// Provide a specialization for hash<CallbackHandle> so it can easily be stored in unordered_set.
+MONGO_HASH_NAMESPACE_START
template <>
struct hash<::mongo::executor::TaskExecutor::CallbackHandle> {
size_t operator()(const ::mongo::executor::TaskExecutor::CallbackHandle& x) const {
return x.hash();
}
};
-} // namespace std
+MONGO_HASH_NAMESPACE_END
diff --git a/src/mongo/platform/hash_namespace.h b/src/mongo/platform/hash_namespace.h
index 6e0b7fcf38a..ef1c15ffad5 100644
--- a/src/mongo/platform/hash_namespace.h
+++ b/src/mongo/platform/hash_namespace.h
@@ -28,7 +28,20 @@
#pragma once
#include <functional>
+#if defined(_WIN32)
+#include <boost/functional/hash.hpp>
+#endif
+#if defined(_WIN32)
+#define MONGO_HASH_NAMESPACE_START namespace boost {
+#else
#define MONGO_HASH_NAMESPACE_START namespace std {
+#endif
+
#define MONGO_HASH_NAMESPACE_END }
+
+#if defined(_WIN32)
+#define MONGO_HASH_NAMESPACE boost
+#else
#define MONGO_HASH_NAMESPACE std
+#endif
diff --git a/src/mongo/platform/unordered_map.h b/src/mongo/platform/unordered_map.h
index 81651e6079d..ee3e80ea387 100644
--- a/src/mongo/platform/unordered_map.h
+++ b/src/mongo/platform/unordered_map.h
@@ -27,10 +27,10 @@
#pragma once
-#include <unordered_map>
+#include "mongo/stdx/unordered_map.h"
namespace mongo {
-using std::unordered_map;
+using stdx::unordered_map;
} // namespace mongo
diff --git a/src/mongo/platform/unordered_set.h b/src/mongo/platform/unordered_set.h
index 5921e9ccded..391ab1b7019 100644
--- a/src/mongo/platform/unordered_set.h
+++ b/src/mongo/platform/unordered_set.h
@@ -27,10 +27,10 @@
#pragma once
-#include <unordered_set>
+#include "mongo/stdx/unordered_set.h"
namespace mongo {
-using std::unordered_set;
+using stdx::unordered_set;
} // namespace mongo
diff --git a/src/mongo/s/balancer/migration_manager.h b/src/mongo/s/balancer/migration_manager.h
index a39b4984346..39fe4e7f0ee 100644
--- a/src/mongo/s/balancer/migration_manager.h
+++ b/src/mongo/s/balancer/migration_manager.h
@@ -30,7 +30,6 @@
#include <list>
#include <map>
-#include <unordered_map>
#include <vector>
#include "mongo/base/disallow_copying.h"
@@ -42,6 +41,7 @@
#include "mongo/s/migration_secondary_throttle_options.h"
#include "mongo/stdx/condition_variable.h"
#include "mongo/stdx/mutex.h"
+#include "mongo/stdx/unordered_map.h"
#include "mongo/util/concurrency/notification.h"
namespace mongo {
@@ -164,7 +164,7 @@ private:
};
using CollectionMigrationsStateMap =
- std::unordered_map<NamespaceString, CollectionMigrationsState>;
+ stdx::unordered_map<NamespaceString, CollectionMigrationsState>;
/**
* Optionally takes the collection distributed lock and schedules a chunk migration with the
diff --git a/src/mongo/s/catalog/replset/replset_dist_lock_manager.h b/src/mongo/s/catalog/replset/replset_dist_lock_manager.h
index 06ca81c56b5..657b7d40031 100644
--- a/src/mongo/s/catalog/replset/replset_dist_lock_manager.h
+++ b/src/mongo/s/catalog/replset/replset_dist_lock_manager.h
@@ -31,7 +31,6 @@
#include <deque>
#include <memory>
#include <string>
-#include <unordered_map>
#include "mongo/base/string_data.h"
#include "mongo/s/catalog/dist_lock_catalog.h"
@@ -41,6 +40,7 @@
#include "mongo/stdx/condition_variable.h"
#include "mongo/stdx/mutex.h"
#include "mongo/stdx/thread.h"
+#include "mongo/stdx/unordered_map.h"
namespace mongo {
@@ -146,7 +146,7 @@ private:
stdx::condition_variable _shutDownCV; // (M)
// Map of lockName to last ping information.
- std::unordered_map<std::string, DistLockPingInfo> _pingHistory; // (M)
+ stdx::unordered_map<std::string, DistLockPingInfo> _pingHistory; // (M)
};
} // namespace mongo
diff --git a/src/mongo/s/chunk_manager_tests.cpp b/src/mongo/s/chunk_manager_tests.cpp
index 3d0bdd4bc8a..0a5ef867256 100644
--- a/src/mongo/s/chunk_manager_tests.cpp
+++ b/src/mongo/s/chunk_manager_tests.cpp
@@ -82,7 +82,7 @@ protected:
static const int numSplitPoints = 100;
void genUniqueRandomSplitKeys(const string& keyName, vector<BSONObj>* splitKeys) {
- std::unordered_set<int> uniquePoints;
+ stdx::unordered_set<int> uniquePoints;
while (static_cast<int>(uniquePoints.size()) < numSplitPoints) {
uniquePoints.insert(rand(numSplitPoints * 10));
}
diff --git a/src/mongo/s/client/shard_registry.h b/src/mongo/s/client/shard_registry.h
index 7c3a4cad9b4..e134cc2e2db 100644
--- a/src/mongo/s/client/shard_registry.h
+++ b/src/mongo/s/client/shard_registry.h
@@ -31,7 +31,6 @@
#include <memory>
#include <set>
#include <string>
-#include <unordered_map>
#include <vector>
#include "mongo/base/disallow_copying.h"
@@ -40,6 +39,7 @@
#include "mongo/s/client/shard.h"
#include "mongo/stdx/condition_variable.h"
#include "mongo/stdx/mutex.h"
+#include "mongo/stdx/unordered_map.h"
namespace mongo {
@@ -121,7 +121,7 @@ private:
// Protects the lookup maps below.
mutable stdx::mutex _mutex;
- using ShardMap = std::unordered_map<ShardId, std::shared_ptr<Shard>, ShardId::Hasher>;
+ using ShardMap = stdx::unordered_map<ShardId, std::shared_ptr<Shard>, ShardId::Hasher>;
// Map of both shardName -> Shard and hostName -> Shard
ShardMap _lookup;
@@ -129,7 +129,7 @@ private:
// Map from replica set name to shard corresponding to this replica set
ShardMap _rsLookup;
- std::unordered_map<HostAndPort, std::shared_ptr<Shard>> _hostLookup;
+ stdx::unordered_map<HostAndPort, std::shared_ptr<Shard>> _hostLookup;
// store configShard separately to always have a reference
std::shared_ptr<Shard> _configShard;
diff --git a/src/mongo/s/query/cluster_cursor_manager.h b/src/mongo/s/query/cluster_cursor_manager.h
index d8f8899c386..ab7a874e69c 100644
--- a/src/mongo/s/query/cluster_cursor_manager.h
+++ b/src/mongo/s/query/cluster_cursor_manager.h
@@ -29,7 +29,6 @@
#pragma once
#include <memory>
-#include <unordered_map>
#include <vector>
#include "mongo/db/cursor_id.h"
@@ -37,6 +36,7 @@
#include "mongo/platform/random.h"
#include "mongo/s/query/cluster_client_cursor.h"
#include "mongo/stdx/mutex.h"
+#include "mongo/stdx/unordered_map.h"
#include "mongo/util/time_support.h"
namespace mongo {
@@ -361,7 +361,7 @@ public:
private:
class CursorEntry;
- using CursorEntryMap = std::unordered_map<CursorId, CursorEntry>;
+ using CursorEntryMap = stdx::unordered_map<CursorId, CursorEntry>;
/**
* Transfers ownership of the given pinned cursor back to the manager, and moves the cursor to
@@ -528,13 +528,13 @@ private:
//
// Entries are added when the first cursor on the given namespace is registered, and removed
// when the last cursor on the given namespace is destroyed.
- std::unordered_map<uint32_t, NamespaceString> _cursorIdPrefixToNamespaceMap;
+ stdx::unordered_map<uint32_t, NamespaceString> _cursorIdPrefixToNamespaceMap;
// Map from namespace to the CursorEntryContainer for that namespace.
//
// Entries are added when the first cursor on the given namespace is registered, and removed
// when the last cursor on the given namespace is destroyed.
- std::unordered_map<NamespaceString, CursorEntryContainer, NamespaceString::Hasher>
+ stdx::unordered_map<NamespaceString, CursorEntryContainer, NamespaceString::Hasher>
_namespaceToContainerMap;
size_t _cursorsTimedOut = 0;
diff --git a/src/mongo/scripting/deadline_monitor.h b/src/mongo/scripting/deadline_monitor.h
index 9a68b78e60f..cd5c532c974 100644
--- a/src/mongo/scripting/deadline_monitor.h
+++ b/src/mongo/scripting/deadline_monitor.h
@@ -172,7 +172,7 @@ private:
}
}
- using TaskDeadlineMap = std::unordered_map<_Task*, Date_t>;
+ using TaskDeadlineMap = stdx::unordered_map<_Task*, Date_t>;
TaskDeadlineMap _tasks; // map of running tasks with deadlines
stdx::mutex _deadlineMutex; // protects all non-const members, except _monitorThread
stdx::condition_variable _newDeadlineAvailable; // Signaled for timeout, start and stop
diff --git a/src/mongo/scripting/mozjs/countdownlatch.cpp b/src/mongo/scripting/mozjs/countdownlatch.cpp
index 9ca93be7618..4d953a11449 100644
--- a/src/mongo/scripting/mozjs/countdownlatch.cpp
+++ b/src/mongo/scripting/mozjs/countdownlatch.cpp
@@ -30,12 +30,11 @@
#include "mongo/scripting/mozjs/countdownlatch.h"
-#include <unordered_map>
-
#include "mongo/scripting/mozjs/implscope.h"
#include "mongo/scripting/mozjs/objectwrapper.h"
#include "mongo/stdx/condition_variable.h"
#include "mongo/stdx/mutex.h"
+#include "mongo/stdx/unordered_map.h"
namespace mongo {
namespace mozjs {
@@ -119,7 +118,7 @@ private:
return iter->second;
}
- using Map = std::unordered_map<int32_t, std::shared_ptr<Latch>>;
+ using Map = stdx::unordered_map<int32_t, std::shared_ptr<Latch>>;
stdx::mutex _mutex;
Map _latches;
diff --git a/src/mongo/scripting/mozjs/engine.h b/src/mongo/scripting/mozjs/engine.h
index 9b3178912e7..8d6cf201e5f 100644
--- a/src/mongo/scripting/mozjs/engine.h
+++ b/src/mongo/scripting/mozjs/engine.h
@@ -29,11 +29,11 @@
#pragma once
#include <jsapi.h>
-#include <unordered_map>
#include "mongo/scripting/deadline_monitor.h"
#include "mongo/scripting/engine.h"
#include "mongo/stdx/mutex.h"
+#include "mongo/stdx/unordered_map.h"
#include "mongo/util/concurrency/mutex.h"
namespace mongo {
@@ -89,7 +89,7 @@ private:
*/
stdx::mutex _globalInterruptLock;
- using OpIdToScopeMap = std::unordered_map<unsigned, MozJSImplScope*>;
+ using OpIdToScopeMap = stdx::unordered_map<unsigned, MozJSImplScope*>;
OpIdToScopeMap _opToScopeMap; // map of mongo op ids to scopes (protected by
// _globalInterruptLock).
diff --git a/src/mongo/shell/shell_utils_launcher.h b/src/mongo/shell/shell_utils_launcher.h
index a5d3543921c..3167b9a28b3 100644
--- a/src/mongo/shell/shell_utils_launcher.h
+++ b/src/mongo/shell/shell_utils_launcher.h
@@ -89,8 +89,8 @@ public:
void getRegisteredPids(std::vector<ProcessId>& pids);
private:
- std::unordered_map<int, ProcessId> _portToPidMap;
- std::unordered_map<ProcessId, int> _outputs;
+ stdx::unordered_map<int, ProcessId> _portToPidMap;
+ stdx::unordered_map<ProcessId, int> _outputs;
mutable stdx::recursive_mutex _mutex;
#ifdef _WIN32
diff --git a/src/mongo/stdx/unordered_map.h b/src/mongo/stdx/unordered_map.h
new file mode 100644
index 00000000000..59fba445074
--- /dev/null
+++ b/src/mongo/stdx/unordered_map.h
@@ -0,0 +1,47 @@
+/**
+ * Copyright (C) 2016 MongoDB Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#pragma once
+
+#if defined(_WIN32)
+#include <boost/unordered_map.hpp>
+#else
+#include <unordered_map>
+#endif
+
+namespace mongo {
+namespace stdx {
+
+#if defined(_WIN32)
+using ::boost::unordered_map; // NOLINT
+#else
+using ::std::unordered_map; // NOLINT
+#endif
+
+} // namespace stdx
+} // namespace mongo
diff --git a/src/mongo/stdx/unordered_set.h b/src/mongo/stdx/unordered_set.h
new file mode 100644
index 00000000000..72fb3fa5522
--- /dev/null
+++ b/src/mongo/stdx/unordered_set.h
@@ -0,0 +1,47 @@
+/**
+ * Copyright (C) 2016 MongoDB Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#pragma once
+
+#if defined(_WIN32)
+#include <boost/unordered_set.hpp>
+#else
+#include <unordered_set>
+#endif
+
+namespace mongo {
+namespace stdx {
+
+#if defined(_WIN32)
+using ::boost::unordered_set; // NOLINT
+#else
+using ::std::unordered_set; // NOLINT
+#endif
+
+} // namespace stdx
+} // namespace mongo
diff --git a/src/mongo/tools/bridge_commands.h b/src/mongo/tools/bridge_commands.h
index 5002b697a17..f72c2e37b6a 100644
--- a/src/mongo/tools/bridge_commands.h
+++ b/src/mongo/tools/bridge_commands.h
@@ -28,9 +28,8 @@
#pragma once
-#include <unordered_map>
-
#include "mongo/stdx/mutex.h"
+#include "mongo/stdx/unordered_map.h"
#include "mongo/util/time_support.h"
namespace mongo {
@@ -50,7 +49,7 @@ struct HostSettings {
double loss = 0.0;
};
-using HostSettingsMap = std::unordered_map<HostAndPort, HostSettings>;
+using HostSettingsMap = stdx::unordered_map<HostAndPort, HostSettings>;
class Command {
public:
diff --git a/src/mongo/transport/service_entry_point_test_suite.cpp b/src/mongo/transport/service_entry_point_test_suite.cpp
index c3814accc47..04dd760db4a 100644
--- a/src/mongo/transport/service_entry_point_test_suite.cpp
+++ b/src/mongo/transport/service_entry_point_test_suite.cpp
@@ -33,8 +33,6 @@
#include "mongo/transport/service_entry_point_test_suite.h"
#include <boost/optional.hpp>
-#include <unordered_map>
-#include <unordered_set>
#include "mongo/bson/bsonmisc.h"
#include "mongo/bson/bsonobjbuilder.h"
@@ -44,6 +42,8 @@
#include "mongo/stdx/future.h"
#include "mongo/stdx/memory.h"
#include "mongo/stdx/mutex.h"
+#include "mongo/stdx/unordered_map.h"
+#include "mongo/stdx/unordered_set.h"
#include "mongo/transport/service_entry_point.h"
#include "mongo/transport/session.h"
#include "mongo/transport/ticket.h"
@@ -151,7 +151,7 @@ void ServiceEntryPointTestSuite::MockTLHarness::asyncWait(Ticket&& ticket,
SSLPeerInfo ServiceEntryPointTestSuite::MockTLHarness::getX509PeerInfo(
const Session& session) const {
- return SSLPeerInfo("mock", {});
+ return SSLPeerInfo("mock", stdx::unordered_set<RoleName>{});
}
void ServiceEntryPointTestSuite::MockTLHarness::registerTags(const Session& session) {}
@@ -395,7 +395,7 @@ void ServiceEntryPointTestSuite::burstStressTest(int numSessions,
auto allCompleteFuture = allSessionsComplete.get_future();
stdx::mutex cyclesLock;
- std::unordered_map<Session::Id, int> completedCycles;
+ stdx::unordered_map<Session::Id, int> completedCycles;
_tl->_resetHooks();
diff --git a/src/mongo/transport/transport_layer_legacy.h b/src/mongo/transport/transport_layer_legacy.h
index d9b2964f8f5..90078f2cf53 100644
--- a/src/mongo/transport/transport_layer_legacy.h
+++ b/src/mongo/transport/transport_layer_legacy.h
@@ -28,11 +28,10 @@
#pragma once
-#include <unordered_map>
-
#include "mongo/stdx/memory.h"
#include "mongo/stdx/mutex.h"
#include "mongo/stdx/thread.h"
+#include "mongo/stdx/unordered_map.h"
#include "mongo/transport/ticket_impl.h"
#include "mongo/transport/transport_layer.h"
#include "mongo/util/net/listen.h"
@@ -162,7 +161,7 @@ private:
stdx::thread _listenerThread;
mutable stdx::mutex _connectionsMutex;
- std::unordered_map<Session::Id, Connection> _connections;
+ stdx::unordered_map<Session::Id, Connection> _connections;
void _endSession_inlock(decltype(_connections.begin()) conn);
diff --git a/src/mongo/transport/transport_layer_mock.h b/src/mongo/transport/transport_layer_mock.h
index 6800e37b666..73a14006dbb 100644
--- a/src/mongo/transport/transport_layer_mock.h
+++ b/src/mongo/transport/transport_layer_mock.h
@@ -28,9 +28,8 @@
#pragma once
-#include <unordered_map>
-
#include "mongo/base/status.h"
+#include "mongo/stdx/unordered_map.h"
#include "mongo/transport/session.h"
#include "mongo/transport/ticket.h"
#include "mongo/transport/ticket_impl.h"
@@ -108,7 +107,7 @@ private:
std::unique_ptr<Session> session;
SSLPeerInfo peerInfo;
};
- std::unordered_map<Session::Id, Connection> _sessions;
+ stdx::unordered_map<Session::Id, Connection> _sessions;
bool _shutdown;
};
diff --git a/src/mongo/util/net/ssl_manager.cpp b/src/mongo/util/net/ssl_manager.cpp
index 2c1ef8c6e72..47ffcf83a01 100644
--- a/src/mongo/util/net/ssl_manager.cpp
+++ b/src/mongo/util/net/ssl_manager.cpp
@@ -296,7 +296,7 @@ private:
Date_t* serverNotAfter);
- StatusWith<std::unordered_set<RoleName>> _parsePeerRoles(X509* peerCert) const;
+ StatusWith<stdx::unordered_set<RoleName>> _parsePeerRoles(X509* peerCert) const;
/** @return true if was successful, otherwise false */
bool _setupPEM(SSL_CTX* context, const std::string& keyFile, const std::string& password);
@@ -1160,7 +1160,7 @@ StatusWith<boost::optional<SSLPeerInfo>> SSLManager::parseAndValidatePeerCertifi
std::string peerSubjectName = getCertificateSubjectName(peerCert);
LOG(2) << "Accepted TLS connection from peer: " << peerSubjectName;
- StatusWith<std::unordered_set<RoleName>> swPeerCertificateRoles = _parsePeerRoles(peerCert);
+ StatusWith<stdx::unordered_set<RoleName>> swPeerCertificateRoles = _parsePeerRoles(peerCert);
if (!swPeerCertificateRoles.isOK()) {
return swPeerCertificateRoles.getStatus();
}
@@ -1227,7 +1227,7 @@ StatusWith<boost::optional<SSLPeerInfo>> SSLManager::parseAndValidatePeerCertifi
}
}
- return boost::make_optional(SSLPeerInfo(peerSubjectName, std::unordered_set<RoleName>()));
+ return boost::make_optional(SSLPeerInfo(peerSubjectName, stdx::unordered_set<RoleName>()));
}
@@ -1242,7 +1242,7 @@ SSLPeerInfo SSLManager::parseAndValidatePeerCertificateDeprecated(const SSLConne
return swPeerSubjectName.getValue().get_value_or(SSLPeerInfo());
}
-StatusWith<std::unordered_set<RoleName>> SSLManager::_parsePeerRoles(X509* peerCert) const {
+StatusWith<stdx::unordered_set<RoleName>> SSLManager::_parsePeerRoles(X509* peerCert) const {
// exts is owned by the peerCert
STACK_OF(X509_EXTENSION)* exts = peerCert->cert_info->extensions;
@@ -1254,7 +1254,7 @@ StatusWith<std::unordered_set<RoleName>> SSLManager::_parsePeerRoles(X509* peerC
ASN1_OBJECT* rolesObj = OBJ_nid2obj(_rolesNid);
// Search all certificate extensions for our own
- std::unordered_set<RoleName> roles;
+ stdx::unordered_set<RoleName> roles;
for (int i = 0; i < extCount; i++) {
X509_EXTENSION* ex = sk_X509_EXTENSION_value(exts, i);
ASN1_OBJECT* obj = X509_EXTENSION_get_object(ex);
diff --git a/src/mongo/util/net/ssl_types.h b/src/mongo/util/net/ssl_types.h
index 87fe6eca59a..fc8f600625c 100644
--- a/src/mongo/util/net/ssl_types.h
+++ b/src/mongo/util/net/ssl_types.h
@@ -28,9 +28,9 @@
#pragma once
#include <string>
-#include <unordered_set>
#include "mongo/db/auth/role_name.h"
+#include "mongo/stdx/unordered_set.h"
namespace mongo {
@@ -39,12 +39,12 @@ namespace mongo {
* outside of the networking stack.
*/
struct SSLPeerInfo {
- SSLPeerInfo(std::string subjectName, std::unordered_set<RoleName> roles)
+ SSLPeerInfo(std::string subjectName, stdx::unordered_set<RoleName> roles)
: subjectName(std::move(subjectName)), roles(std::move(roles)) {}
SSLPeerInfo() = default;
std::string subjectName;
- std::unordered_set<RoleName> roles;
+ stdx::unordered_set<RoleName> roles;
};
} // namespace mongo
diff --git a/src/mongo/util/perfctr_collect.h b/src/mongo/util/perfctr_collect.h
index 4c29fabd1cc..1d6afd6970e 100644
--- a/src/mongo/util/perfctr_collect.h
+++ b/src/mongo/util/perfctr_collect.h
@@ -33,7 +33,6 @@
#include <pdh.h>
#include <pdhmsg.h>
#include <string>
-#include <unordered_map>
#include <vector>
#include "mongo/base/disallow_copying.h"
@@ -41,6 +40,7 @@
#include "mongo/base/status_with.h"
#include "mongo/base/string_data.h"
#include "mongo/stdx/memory.h"
+#include "mongo/stdx/unordered_map.h"
namespace mongo {
@@ -124,10 +124,10 @@ private:
private:
// Vector of counters which are not sub-grouped by instance name.
- std::unordered_map<std::string, std::vector<std::string>> _counters;
+ stdx::unordered_map<std::string, std::vector<std::string>> _counters;
// Vector of counters sub grouped by instance name.
- std::unordered_map<std::string, std::vector<std::string>> _nestedCounters;
+ stdx::unordered_map<std::string, std::vector<std::string>> _nestedCounters;
};
/**
diff --git a/src/third_party/s2/hash.h b/src/third_party/s2/hash.h
index 61c3b409955..48c6cb42abd 100644
--- a/src/third_party/s2/hash.h
+++ b/src/third_party/s2/hash.h
@@ -1,16 +1,14 @@
#ifndef THIRD_PARTY_S2_HASH_H_
#define THIRD_PARTY_S2_HASH_H_
-#include "mongo/platform/hash_namespace.h"
+#include <unordered_map>
+#define hash_map std::unordered_map
-#include "mongo/platform/unordered_map.h"
-#define hash_map mongo::unordered_map
+#include <unordered_set>
+#define hash_set std::unordered_set
-#include "mongo/platform/unordered_set.h"
-#define hash_set mongo::unordered_set
-
-#define HASH_NAMESPACE_START MONGO_HASH_NAMESPACE_START
-#define HASH_NAMESPACE_END MONGO_HASH_NAMESPACE_END
+#define HASH_NAMESPACE_START namespace std {
+#define HASH_NAMESPACE_END }
// Places that hash-related functions are defined:
// end of s2cellid.h for hashing on S2CellId