summaryrefslogtreecommitdiff
path: root/src/mongo/stdx
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2014-06-03 18:27:50 -0400
committerAndy Schwerin <schwerin@mongodb.com>2014-06-04 14:46:26 -0400
commitb0911563b1b996d366451b7d7af732c990274930 (patch)
tree96659b62904cb52e524d54df676655423bc52da4 /src/mongo/stdx
parentf40d275dc14d8fcecde23c077d36305232177d9a (diff)
downloadmongo-b0911563b1b996d366451b7d7af732c990274930.tar.gz
SERVER-14152 Introduce stdx::list and mongo/stdx/list.h.
Diffstat (limited to 'src/mongo/stdx')
-rw-r--r--src/mongo/stdx/list.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/mongo/stdx/list.h b/src/mongo/stdx/list.h
new file mode 100644
index 00000000000..1360d8c487f
--- /dev/null
+++ b/src/mongo/stdx/list.h
@@ -0,0 +1,57 @@
+/**
+ * Copyright (C) 2014 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
+
+#ifdef _MSC_VER
+
+// The MSVS STL implementation of std::list is not standards compliant, at least because it
+// invalidates iterators during std::list::splice operations.
+
+#include <boost/container/list.hpp>
+
+namespace mongo {
+namespace stdx {
+
+ using boost::container::list;
+
+} // namespace stdx
+} // namespace mongo
+
+#else
+
+#include <list>
+
+namespace mongo {
+namespace stdx {
+
+ using std::list;
+
+} // namespace stdx
+} // namespace mongo
+#endif