summaryrefslogtreecommitdiff
path: root/src/mongo/db/update
diff options
context:
space:
mode:
authorADAM David Alan Martin <adam.martin@10gen.com>2019-06-10 01:21:01 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2019-06-10 01:59:35 -0400
commitc36f9ecb91e49da7e637863889804fc4e6c6c05e (patch)
tree64d8aadb6d29042d4f4e7366bc1457e4e0612383 /src/mongo/db/update
parentc9548e729c8fecd9d7a9a5dd341da0433194ac73 (diff)
downloadmongo-c36f9ecb91e49da7e637863889804fc4e6c6c05e.tar.gz
SERVER-39339 Remove `stdx/memory.h`
Diffstat (limited to 'src/mongo/db/update')
-rw-r--r--src/mongo/db/update/addtoset_node.h4
-rw-r--r--src/mongo/db/update/arithmetic_node.h5
-rw-r--r--src/mongo/db/update/array_culling_node.h3
-rw-r--r--src/mongo/db/update/bit_node.h5
-rw-r--r--src/mongo/db/update/compare_node.h5
-rw-r--r--src/mongo/db/update/conflict_placeholder_node.h4
-rw-r--r--src/mongo/db/update/current_date_node.h5
-rw-r--r--src/mongo/db/update/modifier_node.h2
-rw-r--r--src/mongo/db/update/modifier_table.cpp34
-rw-r--r--src/mongo/db/update/object_replace_executor.h2
-rw-r--r--src/mongo/db/update/path_support_test.cpp3
-rw-r--r--src/mongo/db/update/pipeline_executor.h2
-rw-r--r--src/mongo/db/update/pop_node.h5
-rw-r--r--src/mongo/db/update/pull_node.cpp16
-rw-r--r--src/mongo/db/update/pull_node.h5
-rw-r--r--src/mongo/db/update/pullall_node.cpp4
-rw-r--r--src/mongo/db/update/pullall_node.h5
-rw-r--r--src/mongo/db/update/push_node.h4
-rw-r--r--src/mongo/db/update/rename_node.cpp2
-rw-r--r--src/mongo/db/update/rename_node.h4
-rw-r--r--src/mongo/db/update/set_node.h5
-rw-r--r--src/mongo/db/update/unset_node.h5
-rw-r--r--src/mongo/db/update/update_array_node.cpp2
-rw-r--r--src/mongo/db/update/update_array_node.h4
-rw-r--r--src/mongo/db/update/update_driver.cpp10
-rw-r--r--src/mongo/db/update/update_node_test_fixture.h8
-rw-r--r--src/mongo/db/update/update_object_node.cpp9
-rw-r--r--src/mongo/db/update/update_object_node.h4
28 files changed, 88 insertions, 78 deletions
diff --git a/src/mongo/db/update/addtoset_node.h b/src/mongo/db/update/addtoset_node.h
index d634691011f..74564c91c47 100644
--- a/src/mongo/db/update/addtoset_node.h
+++ b/src/mongo/db/update/addtoset_node.h
@@ -29,12 +29,12 @@
#pragma once
+#include <memory>
#include <vector>
#include "mongo/base/string_data.h"
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/db/update/modifier_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -46,7 +46,7 @@ public:
Status init(BSONElement modExpr, const boost::intrusive_ptr<ExpressionContext>& expCtx) final;
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<AddToSetNode>(*this);
+ return std::make_unique<AddToSetNode>(*this);
}
void setCollator(const CollatorInterface* collator) final;
diff --git a/src/mongo/db/update/arithmetic_node.h b/src/mongo/db/update/arithmetic_node.h
index b24c3391f4e..c450e6dcdcc 100644
--- a/src/mongo/db/update/arithmetic_node.h
+++ b/src/mongo/db/update/arithmetic_node.h
@@ -29,9 +29,10 @@
#pragma once
+#include <memory>
+
#include "mongo/base/string_data.h"
#include "mongo/db/update/modifier_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -47,7 +48,7 @@ public:
Status init(BSONElement modExpr, const boost::intrusive_ptr<ExpressionContext>& expCtx) final;
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<ArithmeticNode>(*this);
+ return std::make_unique<ArithmeticNode>(*this);
}
void setCollator(const CollatorInterface* collator) final {}
diff --git a/src/mongo/db/update/array_culling_node.h b/src/mongo/db/update/array_culling_node.h
index c9b36e97682..dd59033d3b7 100644
--- a/src/mongo/db/update/array_culling_node.h
+++ b/src/mongo/db/update/array_culling_node.h
@@ -29,9 +29,10 @@
#pragma once
+#include <memory>
+
#include "mongo/base/clonable_ptr.h"
#include "mongo/db/update/modifier_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
diff --git a/src/mongo/db/update/bit_node.h b/src/mongo/db/update/bit_node.h
index 96840fdec1e..07812b3e08a 100644
--- a/src/mongo/db/update/bit_node.h
+++ b/src/mongo/db/update/bit_node.h
@@ -29,10 +29,11 @@
#pragma once
+#include <memory>
+
#include "mongo/base/string_data.h"
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/db/update/modifier_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -44,7 +45,7 @@ public:
Status init(BSONElement modExpr, const boost::intrusive_ptr<ExpressionContext>& expCtx) final;
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<BitNode>(*this);
+ return std::make_unique<BitNode>(*this);
}
void setCollator(const CollatorInterface* collator) final {}
diff --git a/src/mongo/db/update/compare_node.h b/src/mongo/db/update/compare_node.h
index 95bcd666d8f..a1f25f96203 100644
--- a/src/mongo/db/update/compare_node.h
+++ b/src/mongo/db/update/compare_node.h
@@ -29,9 +29,10 @@
#pragma once
+#include <memory>
+
#include "mongo/base/string_data.h"
#include "mongo/db/update/modifier_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -47,7 +48,7 @@ public:
Status init(BSONElement modExpr, const boost::intrusive_ptr<ExpressionContext>& expCtx) final;
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<CompareNode>(*this);
+ return std::make_unique<CompareNode>(*this);
}
void setCollator(const CollatorInterface* collator) final;
diff --git a/src/mongo/db/update/conflict_placeholder_node.h b/src/mongo/db/update/conflict_placeholder_node.h
index 469613a515c..a1cf0cacda5 100644
--- a/src/mongo/db/update/conflict_placeholder_node.h
+++ b/src/mongo/db/update/conflict_placeholder_node.h
@@ -30,12 +30,12 @@
#pragma once
#include <map>
+#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "mongo/db/update/update_leaf_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -55,7 +55,7 @@ public:
}
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<ConflictPlaceholderNode>(*this);
+ return std::make_unique<ConflictPlaceholderNode>(*this);
}
void setCollator(const CollatorInterface* collator) final {}
diff --git a/src/mongo/db/update/current_date_node.h b/src/mongo/db/update/current_date_node.h
index 7872dadce9a..a28de18ad36 100644
--- a/src/mongo/db/update/current_date_node.h
+++ b/src/mongo/db/update/current_date_node.h
@@ -29,9 +29,10 @@
#pragma once
+#include <memory>
+
#include "mongo/base/string_data.h"
#include "mongo/db/update/modifier_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -43,7 +44,7 @@ public:
Status init(BSONElement modExpr, const boost::intrusive_ptr<ExpressionContext>& expCtx) final;
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<CurrentDateNode>(*this);
+ return std::make_unique<CurrentDateNode>(*this);
}
void setCollator(const CollatorInterface* collator) final {}
diff --git a/src/mongo/db/update/modifier_node.h b/src/mongo/db/update/modifier_node.h
index 4649cbc03aa..4c26735400d 100644
--- a/src/mongo/db/update/modifier_node.h
+++ b/src/mongo/db/update/modifier_node.h
@@ -30,13 +30,13 @@
#pragma once
#include <map>
+#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "mongo/base/string_data.h"
#include "mongo/db/update/update_leaf_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
diff --git a/src/mongo/db/update/modifier_table.cpp b/src/mongo/db/update/modifier_table.cpp
index e46a7fb2de4..ed054989547 100644
--- a/src/mongo/db/update/modifier_table.cpp
+++ b/src/mongo/db/update/modifier_table.cpp
@@ -29,6 +29,7 @@
#include "mongo/db/update/modifier_table.h"
+#include <memory>
#include <string>
#include <utility>
@@ -48,7 +49,6 @@
#include "mongo/db/update/rename_node.h"
#include "mongo/db/update/set_node.h"
#include "mongo/db/update/unset_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -138,37 +138,37 @@ ModifierType getType(StringData typeStr) {
std::unique_ptr<UpdateLeafNode> makeUpdateLeafNode(ModifierType modType) {
switch (modType) {
case MOD_ADD_TO_SET:
- return stdx::make_unique<AddToSetNode>();
+ return std::make_unique<AddToSetNode>();
case MOD_BIT:
- return stdx::make_unique<BitNode>();
+ return std::make_unique<BitNode>();
case MOD_CONFLICT_PLACEHOLDER:
- return stdx::make_unique<ConflictPlaceholderNode>();
+ return std::make_unique<ConflictPlaceholderNode>();
case MOD_CURRENTDATE:
- return stdx::make_unique<CurrentDateNode>();
+ return std::make_unique<CurrentDateNode>();
case MOD_INC:
- return stdx::make_unique<ArithmeticNode>(ArithmeticNode::ArithmeticOp::kAdd);
+ return std::make_unique<ArithmeticNode>(ArithmeticNode::ArithmeticOp::kAdd);
case MOD_MAX:
- return stdx::make_unique<CompareNode>(CompareNode::CompareMode::kMax);
+ return std::make_unique<CompareNode>(CompareNode::CompareMode::kMax);
case MOD_MIN:
- return stdx::make_unique<CompareNode>(CompareNode::CompareMode::kMin);
+ return std::make_unique<CompareNode>(CompareNode::CompareMode::kMin);
case MOD_MUL:
- return stdx::make_unique<ArithmeticNode>(ArithmeticNode::ArithmeticOp::kMultiply);
+ return std::make_unique<ArithmeticNode>(ArithmeticNode::ArithmeticOp::kMultiply);
case MOD_POP:
- return stdx::make_unique<PopNode>();
+ return std::make_unique<PopNode>();
case MOD_PULL:
- return stdx::make_unique<PullNode>();
+ return std::make_unique<PullNode>();
case MOD_PULL_ALL:
- return stdx::make_unique<PullAllNode>();
+ return std::make_unique<PullAllNode>();
case MOD_PUSH:
- return stdx::make_unique<PushNode>();
+ return std::make_unique<PushNode>();
case MOD_RENAME:
- return stdx::make_unique<RenameNode>();
+ return std::make_unique<RenameNode>();
case MOD_SET:
- return stdx::make_unique<SetNode>();
+ return std::make_unique<SetNode>();
case MOD_SET_ON_INSERT:
- return stdx::make_unique<SetNode>(UpdateNode::Context::kInsertOnly);
+ return std::make_unique<SetNode>(UpdateNode::Context::kInsertOnly);
case MOD_UNSET:
- return stdx::make_unique<UnsetNode>();
+ return std::make_unique<UnsetNode>();
default:
return nullptr;
}
diff --git a/src/mongo/db/update/object_replace_executor.h b/src/mongo/db/update/object_replace_executor.h
index f141f169d6f..c2b38154560 100644
--- a/src/mongo/db/update/object_replace_executor.h
+++ b/src/mongo/db/update/object_replace_executor.h
@@ -30,12 +30,12 @@
#pragma once
#include <map>
+#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "mongo/db/update/update_executor.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
diff --git a/src/mongo/db/update/path_support_test.cpp b/src/mongo/db/update/path_support_test.cpp
index 78f721e558d..b9c3c0685a8 100644
--- a/src/mongo/db/update/path_support_test.cpp
+++ b/src/mongo/db/update/path_support_test.cpp
@@ -50,7 +50,6 @@
#include "mongo/db/matcher/expression_leaf.h"
#include "mongo/db/matcher/expression_parser.h"
#include "mongo/db/pipeline/expression_context_for_test.h"
-#include "mongo/stdx/memory.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/str.h"
@@ -724,7 +723,7 @@ public:
ImmutablePaths() {}
void addPath(const string& path) {
- _ownedPaths.push_back(stdx::make_unique<FieldRef>(path));
+ _ownedPaths.push_back(std::make_unique<FieldRef>(path));
FieldRef const* conflictPath = NULL;
ASSERT(_immutablePathSet.insert(_ownedPaths.back().get(), &conflictPath));
}
diff --git a/src/mongo/db/update/pipeline_executor.h b/src/mongo/db/update/pipeline_executor.h
index be8d4b6e0f5..e0b16b851c2 100644
--- a/src/mongo/db/update/pipeline_executor.h
+++ b/src/mongo/db/update/pipeline_executor.h
@@ -30,6 +30,7 @@
#pragma once
#include <map>
+#include <memory>
#include <string>
#include <utility>
#include <vector>
@@ -37,7 +38,6 @@
#include "mongo/db/pipeline/document_source.h"
#include "mongo/db/pipeline/pipeline.h"
#include "mongo/db/update/update_executor.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
diff --git a/src/mongo/db/update/pop_node.h b/src/mongo/db/update/pop_node.h
index bf15cb2731a..e731a1956fb 100644
--- a/src/mongo/db/update/pop_node.h
+++ b/src/mongo/db/update/pop_node.h
@@ -29,9 +29,10 @@
#pragma once
+#include <memory>
+
#include "mongo/base/string_data.h"
#include "mongo/db/update/modifier_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -49,7 +50,7 @@ public:
ModifyResult modifyResult) const final;
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<PopNode>(*this);
+ return std::make_unique<PopNode>(*this);
}
void setCollator(const CollatorInterface* collator) final {}
diff --git a/src/mongo/db/update/pull_node.cpp b/src/mongo/db/update/pull_node.cpp
index 46678b9a43c..def1a621402 100644
--- a/src/mongo/db/update/pull_node.cpp
+++ b/src/mongo/db/update/pull_node.cpp
@@ -45,11 +45,11 @@ public:
ObjectMatcher(BSONObj matchCondition, const boost::intrusive_ptr<ExpressionContext>& expCtx)
: _matchExpr(matchCondition,
expCtx,
- stdx::make_unique<ExtensionsCallbackNoop>(),
+ std::make_unique<ExtensionsCallbackNoop>(),
MatchExpressionParser::kBanAllSpecialFeatures) {}
std::unique_ptr<ElementMatcher> clone() const final {
- return stdx::make_unique<ObjectMatcher>(*this);
+ return std::make_unique<ObjectMatcher>(*this);
}
bool match(const mutablebson::ConstElement& element) final {
@@ -85,11 +85,11 @@ public:
const boost::intrusive_ptr<ExpressionContext>& expCtx)
: _matchExpr(matchCondition.wrap(""),
expCtx,
- stdx::make_unique<ExtensionsCallbackNoop>(),
+ std::make_unique<ExtensionsCallbackNoop>(),
MatchExpressionParser::kBanAllSpecialFeatures) {}
std::unique_ptr<ElementMatcher> clone() const final {
- return stdx::make_unique<WrappedObjectMatcher>(*this);
+ return std::make_unique<WrappedObjectMatcher>(*this);
}
bool match(const mutablebson::ConstElement& element) final {
@@ -119,7 +119,7 @@ public:
: _modExpr(modExpr), _collator(collator) {}
std::unique_ptr<ElementMatcher> clone() const final {
- return stdx::make_unique<EqualityMatcher>(*this);
+ return std::make_unique<EqualityMatcher>(*this);
}
bool match(const mutablebson::ConstElement& element) final {
@@ -146,11 +146,11 @@ Status PullNode::init(BSONElement modExpr, const boost::intrusive_ptr<Expression
if (modExpr.type() == mongo::Object &&
!MatchExpressionParser::parsePathAcceptingKeyword(
modExpr.embeddedObject().firstElement())) {
- _matcher = stdx::make_unique<ObjectMatcher>(modExpr.embeddedObject(), expCtx);
+ _matcher = std::make_unique<ObjectMatcher>(modExpr.embeddedObject(), expCtx);
} else if (modExpr.type() == mongo::Object || modExpr.type() == mongo::RegEx) {
- _matcher = stdx::make_unique<WrappedObjectMatcher>(modExpr, expCtx);
+ _matcher = std::make_unique<WrappedObjectMatcher>(modExpr, expCtx);
} else {
- _matcher = stdx::make_unique<EqualityMatcher>(modExpr, expCtx->getCollator());
+ _matcher = std::make_unique<EqualityMatcher>(modExpr, expCtx->getCollator());
}
} catch (AssertionException& exception) {
return exception.toStatus();
diff --git a/src/mongo/db/update/pull_node.h b/src/mongo/db/update/pull_node.h
index 71ecf81bae7..63fe5791fab 100644
--- a/src/mongo/db/update/pull_node.h
+++ b/src/mongo/db/update/pull_node.h
@@ -29,9 +29,10 @@
#pragma once
+#include <memory>
+
#include "mongo/base/string_data.h"
#include "mongo/db/update/array_culling_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -47,7 +48,7 @@ public:
Status init(BSONElement modExpr, const boost::intrusive_ptr<ExpressionContext>& expCtx) final;
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<PullNode>(*this);
+ return std::make_unique<PullNode>(*this);
}
void acceptVisitor(UpdateNodeVisitor* visitor) final {
diff --git a/src/mongo/db/update/pullall_node.cpp b/src/mongo/db/update/pullall_node.cpp
index c082823657c..e4c0936fa83 100644
--- a/src/mongo/db/update/pullall_node.cpp
+++ b/src/mongo/db/update/pullall_node.cpp
@@ -42,7 +42,7 @@ public:
: _elementsToMatch(std::move(elementsToMatch)), _collator(collator) {}
std::unique_ptr<ElementMatcher> clone() const final {
- return stdx::make_unique<SetMatcher>(*this);
+ return std::make_unique<SetMatcher>(*this);
}
bool match(const mutablebson::ConstElement& element) final {
@@ -83,7 +83,7 @@ Status PullAllNode::init(BSONElement modExpr,
<< typeName(modExpr.type()));
}
- _matcher = stdx::make_unique<SetMatcher>(modExpr.Array(), expCtx->getCollator());
+ _matcher = std::make_unique<SetMatcher>(modExpr.Array(), expCtx->getCollator());
return Status::OK();
}
diff --git a/src/mongo/db/update/pullall_node.h b/src/mongo/db/update/pullall_node.h
index e529123e5ef..432c143ee52 100644
--- a/src/mongo/db/update/pullall_node.h
+++ b/src/mongo/db/update/pullall_node.h
@@ -29,9 +29,10 @@
#pragma once
+#include <memory>
+
#include "mongo/base/string_data.h"
#include "mongo/db/update/array_culling_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -47,7 +48,7 @@ public:
Status init(BSONElement modExpr, const boost::intrusive_ptr<ExpressionContext>& expCtx) final;
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<PullAllNode>(*this);
+ return std::make_unique<PullAllNode>(*this);
}
void acceptVisitor(UpdateNodeVisitor* visitor) final {
diff --git a/src/mongo/db/update/push_node.h b/src/mongo/db/update/push_node.h
index beab21950cc..33677ae6652 100644
--- a/src/mongo/db/update/push_node.h
+++ b/src/mongo/db/update/push_node.h
@@ -31,12 +31,12 @@
#include <boost/optional.hpp>
#include <limits>
+#include <memory>
#include <vector>
#include "mongo/base/string_data.h"
#include "mongo/db/update/modifier_node.h"
#include "mongo/db/update/push_sorter.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -45,7 +45,7 @@ public:
Status init(BSONElement modExpr, const boost::intrusive_ptr<ExpressionContext>& expCtx) final;
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<PushNode>(*this);
+ return std::make_unique<PushNode>(*this);
}
void setCollator(const CollatorInterface* collator) final {
diff --git a/src/mongo/db/update/rename_node.cpp b/src/mongo/db/update/rename_node.cpp
index 4177a5f446d..bdf968664d0 100644
--- a/src/mongo/db/update/rename_node.cpp
+++ b/src/mongo/db/update/rename_node.cpp
@@ -59,7 +59,7 @@ public:
SetElementNode(mutablebson::Element elemToSet) : _elemToSet(elemToSet) {}
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<SetElementNode>(*this);
+ return std::make_unique<SetElementNode>(*this);
}
void setCollator(const CollatorInterface* collator) final {}
diff --git a/src/mongo/db/update/rename_node.h b/src/mongo/db/update/rename_node.h
index 5dd23287e8d..668f42d5125 100644
--- a/src/mongo/db/update/rename_node.h
+++ b/src/mongo/db/update/rename_node.h
@@ -30,12 +30,12 @@
#pragma once
#include <map>
+#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "mongo/db/update/update_leaf_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -52,7 +52,7 @@ public:
Status init(BSONElement modExpr, const boost::intrusive_ptr<ExpressionContext>& expCtx) final;
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<RenameNode>(*this);
+ return std::make_unique<RenameNode>(*this);
}
void setCollator(const CollatorInterface* collator) final {}
diff --git a/src/mongo/db/update/set_node.h b/src/mongo/db/update/set_node.h
index f16c752f84d..4261f3e736b 100644
--- a/src/mongo/db/update/set_node.h
+++ b/src/mongo/db/update/set_node.h
@@ -29,9 +29,10 @@
#pragma once
+#include <memory>
+
#include "mongo/base/string_data.h"
#include "mongo/db/update/modifier_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -45,7 +46,7 @@ public:
Status init(BSONElement modExpr, const boost::intrusive_ptr<ExpressionContext>& expCtx) final;
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<SetNode>(*this);
+ return std::make_unique<SetNode>(*this);
}
void setCollator(const CollatorInterface* collator) final {}
diff --git a/src/mongo/db/update/unset_node.h b/src/mongo/db/update/unset_node.h
index 7a773a821aa..8fc466fef4f 100644
--- a/src/mongo/db/update/unset_node.h
+++ b/src/mongo/db/update/unset_node.h
@@ -29,9 +29,10 @@
#pragma once
+#include <memory>
+
#include "mongo/base/string_data.h"
#include "mongo/db/update/modifier_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -43,7 +44,7 @@ public:
Status init(BSONElement modExpr, const boost::intrusive_ptr<ExpressionContext>& expCtx) final;
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<UnsetNode>(*this);
+ return std::make_unique<UnsetNode>(*this);
}
void setCollator(const CollatorInterface* collator) final {}
diff --git a/src/mongo/db/update/update_array_node.cpp b/src/mongo/db/update/update_array_node.cpp
index ab062760d62..53a4070e0ed 100644
--- a/src/mongo/db/update/update_array_node.cpp
+++ b/src/mongo/db/update/update_array_node.cpp
@@ -38,7 +38,7 @@ std::unique_ptr<UpdateNode> UpdateArrayNode::createUpdateNodeByMerging(
const UpdateArrayNode& leftNode, const UpdateArrayNode& rightNode, FieldRef* pathTaken) {
invariant(&leftNode._arrayFilters == &rightNode._arrayFilters);
- auto mergedNode = stdx::make_unique<UpdateArrayNode>(leftNode._arrayFilters);
+ auto mergedNode = std::make_unique<UpdateArrayNode>(leftNode._arrayFilters);
const bool wrapFieldNameAsArrayFilterIdentifier = true;
mergedNode->_children = createUpdateNodeMapByMerging(
diff --git a/src/mongo/db/update/update_array_node.h b/src/mongo/db/update/update_array_node.h
index 0c0ec5550d8..7d942698953 100644
--- a/src/mongo/db/update/update_array_node.h
+++ b/src/mongo/db/update/update_array_node.h
@@ -30,6 +30,7 @@
#pragma once
#include <map>
+#include <memory>
#include <string>
#include <utility>
#include <vector>
@@ -37,7 +38,6 @@
#include "mongo/base/clonable_ptr.h"
#include "mongo/db/matcher/expression_with_placeholder.h"
#include "mongo/db/update/update_internal_node.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -66,7 +66,7 @@ public:
: UpdateInternalNode(Type::Array), _arrayFilters(arrayFilters) {}
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<UpdateArrayNode>(*this);
+ return std::make_unique<UpdateArrayNode>(*this);
}
void setCollator(const CollatorInterface* collator) final {
diff --git a/src/mongo/db/update/update_driver.cpp b/src/mongo/db/update/update_driver.cpp
index 3f2024dba1c..4cd79d7b1cf 100644
--- a/src/mongo/db/update/update_driver.cpp
+++ b/src/mongo/db/update/update_driver.cpp
@@ -159,7 +159,7 @@ void UpdateDriver::parse(
"arrayFilters may not be specified for pipeline-syle updates",
arrayFilters.empty());
_updateExecutor =
- stdx::make_unique<PipelineExecutor>(_expCtx, updateMod.getUpdatePipeline(), constants);
+ std::make_unique<PipelineExecutor>(_expCtx, updateMod.getUpdatePipeline(), constants);
_updateType = UpdateType::kPipeline;
return;
}
@@ -172,7 +172,7 @@ void UpdateDriver::parse(
"multi update is not supported for replacement-style update",
!multi);
- _updateExecutor = stdx::make_unique<ObjectReplaceExecutor>(updateMod.getUpdateClassic());
+ _updateExecutor = std::make_unique<ObjectReplaceExecutor>(updateMod.getUpdateClassic());
// Register the fact that this driver will only do full object replacements.
_updateType = UpdateType::kReplacement;
@@ -195,9 +195,9 @@ void UpdateDriver::parse(
uassertStatusOK(updateSemanticsFromElement(updateSemanticsElement));
}
- auto root = stdx::make_unique<UpdateObjectNode>();
+ auto root = std::make_unique<UpdateObjectNode>();
_positional = parseUpdateExpression(updateExpr, root.get(), _expCtx, arrayFilters);
- _updateExecutor = stdx::make_unique<UpdateTreeExecutor>(std::move(root));
+ _updateExecutor = std::make_unique<UpdateTreeExecutor>(std::move(root));
}
Status UpdateDriver::populateDocumentWithQueryFields(OperationContext* opCtx,
@@ -207,7 +207,7 @@ Status UpdateDriver::populateDocumentWithQueryFields(OperationContext* opCtx,
// We canonicalize the query to collapse $and/$or, and the namespace is not needed. Also,
// because this is for the upsert case, where we insert a new document if one was not found, the
// $where/$text clauses do not make sense, hence empty ExtensionsCallback.
- auto qr = stdx::make_unique<QueryRequest>(NamespaceString(""));
+ auto qr = std::make_unique<QueryRequest>(NamespaceString(""));
qr->setFilter(query);
const boost::intrusive_ptr<ExpressionContext> expCtx;
// $expr is not allowed in the query for an upsert, since it is not clear what the equality
diff --git a/src/mongo/db/update/update_node_test_fixture.h b/src/mongo/db/update/update_node_test_fixture.h
index 73953167ffc..e0b448fd9e4 100644
--- a/src/mongo/db/update/update_node_test_fixture.h
+++ b/src/mongo/db/update/update_node_test_fixture.h
@@ -47,7 +47,7 @@ protected:
// Set up the logical clock needed by CurrentDateNode and ObjectReplaceExecutor.
auto service = mongo::getGlobalServiceContext();
- auto logicalClock = mongo::stdx::make_unique<mongo::LogicalClock>(service);
+ auto logicalClock = std::make_unique<mongo::LogicalClock>(service);
mongo::LogicalClock::set(service, std::move(logicalClock));
}
@@ -62,7 +62,7 @@ protected:
_validateForStorage = true;
_indexData.reset();
_logDoc.reset();
- _logBuilder = stdx::make_unique<LogBuilder>(_logDoc.root());
+ _logBuilder = std::make_unique<LogBuilder>(_logDoc.root());
_modifiedPaths.clear();
}
@@ -86,7 +86,7 @@ protected:
}
void addImmutablePath(StringData path) {
- auto fieldRef = stdx::make_unique<FieldRef>(path);
+ auto fieldRef = std::make_unique<FieldRef>(path);
_immutablePathsVector.push_back(std::move(fieldRef));
_immutablePaths.insert(_immutablePathsVector.back().get());
}
@@ -119,7 +119,7 @@ protected:
void addIndexedPath(StringData path) {
if (!_indexData) {
- _indexData = stdx::make_unique<UpdateIndexData>();
+ _indexData = std::make_unique<UpdateIndexData>();
}
_indexData->addPath(FieldRef(path));
}
diff --git a/src/mongo/db/update/update_object_node.cpp b/src/mongo/db/update/update_object_node.cpp
index 3ca3a85f797..6298b8389c5 100644
--- a/src/mongo/db/update/update_object_node.cpp
+++ b/src/mongo/db/update/update_object_node.cpp
@@ -31,12 +31,13 @@
#include "mongo/db/update/update_object_node.h"
+#include <memory>
+
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/db/update/field_checker.h"
#include "mongo/db/update/modifier_table.h"
#include "mongo/db/update/update_array_node.h"
#include "mongo/db/update/update_leaf_node.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/str.h"
namespace mongo {
@@ -303,9 +304,9 @@ StatusWith<bool> UpdateObjectNode::parseAndMerge(
} else {
std::unique_ptr<UpdateInternalNode> ownedChild;
if (childShouldBeArrayNode) {
- ownedChild = stdx::make_unique<UpdateArrayNode>(arrayFilters);
+ ownedChild = std::make_unique<UpdateArrayNode>(arrayFilters);
} else {
- ownedChild = stdx::make_unique<UpdateObjectNode>();
+ ownedChild = std::make_unique<UpdateObjectNode>();
}
child = ownedChild.get();
current->setChild(std::move(childName), std::move(ownedChild));
@@ -347,7 +348,7 @@ StatusWith<bool> UpdateObjectNode::parseAndMerge(
// static
std::unique_ptr<UpdateNode> UpdateObjectNode::createUpdateNodeByMerging(
const UpdateObjectNode& leftNode, const UpdateObjectNode& rightNode, FieldRef* pathTaken) {
- auto mergedNode = stdx::make_unique<UpdateObjectNode>();
+ auto mergedNode = std::make_unique<UpdateObjectNode>();
mergedNode->_children =
createUpdateNodeMapByMerging(leftNode._children, rightNode._children, pathTaken);
diff --git a/src/mongo/db/update/update_object_node.h b/src/mongo/db/update/update_object_node.h
index 5cbae91f1a5..6f9bed7357a 100644
--- a/src/mongo/db/update/update_object_node.h
+++ b/src/mongo/db/update/update_object_node.h
@@ -30,6 +30,7 @@
#pragma once
#include <map>
+#include <memory>
#include <string>
#include <utility>
#include <vector>
@@ -39,7 +40,6 @@
#include "mongo/db/matcher/expression_with_placeholder.h"
#include "mongo/db/update/modifier_table.h"
#include "mongo/db/update/update_internal_node.h"
-#include "mongo/stdx/memory.h"
#include "mongo/stdx/unordered_map.h"
namespace mongo {
@@ -82,7 +82,7 @@ public:
UpdateObjectNode() : UpdateInternalNode(Type::Object) {}
std::unique_ptr<UpdateNode> clone() const final {
- return stdx::make_unique<UpdateObjectNode>(*this);
+ return std::make_unique<UpdateObjectNode>(*this);
}
void setCollator(const CollatorInterface* collator) final {