summaryrefslogtreecommitdiff
path: root/src/mongo/stdx
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2016-09-01 12:00:47 -0400
committerDavid Storch <david.storch@10gen.com>2016-09-08 22:43:36 -0400
commit0f695019bd0b736e0aac0c510290175f0ec8f274 (patch)
tree0a7e318bbb2753e2ac082e799a940d2c62125e72 /src/mongo/stdx
parentf0df1d05b6098bfc01d0351e6867f044542d3b39 (diff)
downloadmongo-0f695019bd0b736e0aac0c510290175f0ec8f274.tar.gz
SERVER-25865 stdx::unordered_map and stdx::unordered_set
On Windows, these are aliases for boost containers. On other platforms they are aliases for std containers.
Diffstat (limited to 'src/mongo/stdx')
-rw-r--r--src/mongo/stdx/unordered_map.h47
-rw-r--r--src/mongo/stdx/unordered_set.h47
2 files changed, 94 insertions, 0 deletions
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