summaryrefslogtreecommitdiff
path: root/src/mongo/bson
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2015-06-10 18:08:48 -0400
committerAndrew Morrow <acm@mongodb.com>2015-06-10 22:37:49 -0400
commitd7d1fdb75966c684e9a42150e6e9b69c4a10ee08 (patch)
treed28b0767cbd8c1a09535f1676152e7ac57e829ce /src/mongo/bson
parenta9b6612f5322f916298c19a6728817a1034c6aab (diff)
downloadmongo-d7d1fdb75966c684e9a42150e6e9b69c4a10ee08.tar.gz
SERVER-17308 Replace boost::scoped_ptr<T> with std::unique_ptr<T>
Diffstat (limited to 'src/mongo/bson')
-rw-r--r--src/mongo/bson/json.cpp7
-rw-r--r--src/mongo/bson/mutable/document.cpp3
-rw-r--r--src/mongo/bson/mutable/document.h3
-rw-r--r--src/mongo/bson/oid.cpp7
4 files changed, 8 insertions, 12 deletions
diff --git a/src/mongo/bson/json.cpp b/src/mongo/bson/json.cpp
index 3bf5c531cd0..961033570da 100644
--- a/src/mongo/bson/json.cpp
+++ b/src/mongo/bson/json.cpp
@@ -29,7 +29,6 @@
#include "mongo/bson/json.h"
-#include <boost/scoped_ptr.hpp>
#include "mongo/base/parse_number.h"
#include "mongo/db/jsobj.h"
@@ -43,7 +42,7 @@
namespace mongo {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using std::ostringstream;
using std::string;
@@ -325,7 +324,7 @@ namespace mongo {
// Only create a sub builder if this is not the base object
BSONObjBuilder* objBuilder = &builder;
- scoped_ptr<BSONObjBuilder> subObjBuilder;
+ unique_ptr<BSONObjBuilder> subObjBuilder;
if (subObject) {
subObjBuilder.reset(new BSONObjBuilder(builder.subobjStart(fieldName)));
objBuilder = subObjBuilder.get();
@@ -710,7 +709,7 @@ namespace mongo {
}
BSONObjBuilder* arrayBuilder = &builder;
- scoped_ptr<BSONObjBuilder> subObjBuilder;
+ unique_ptr<BSONObjBuilder> subObjBuilder;
if (subObject) {
subObjBuilder.reset(new BSONObjBuilder(builder.subarrayStart(fieldName)));
arrayBuilder = subObjBuilder.get();
diff --git a/src/mongo/bson/mutable/document.cpp b/src/mongo/bson/mutable/document.cpp
index db7fa0bec5e..ddff3e694f2 100644
--- a/src/mongo/bson/mutable/document.cpp
+++ b/src/mongo/bson/mutable/document.cpp
@@ -29,7 +29,6 @@
#include "mongo/bson/mutable/document.h"
-#include <boost/scoped_ptr.hpp>
#include <boost/static_assert.hpp>
#include <cstdlib>
#include <cstring>
@@ -2651,7 +2650,7 @@ namespace mutablebson {
}
inline Document::Impl& Document::getImpl() {
- // Don't use scoped_ptr<Impl>::operator* since it may generate assertions that the
+ // Don't use unique_ptr<Impl>::operator* since it may generate assertions that the
// pointer is non-null, but we already know that to be always and forever true, and
// otherwise the assertion code gets spammed into every method that inlines the call to
// this function. We just dereference the pointer returned from 'get' ourselves.
diff --git a/src/mongo/bson/mutable/document.h b/src/mongo/bson/mutable/document.h
index 2abfc1ca527..9655daddfab 100644
--- a/src/mongo/bson/mutable/document.h
+++ b/src/mongo/bson/mutable/document.h
@@ -27,7 +27,6 @@
#pragma once
-#include <boost/scoped_ptr.hpp>
#include "mongo/base/disallow_copying.h"
#include "mongo/base/string_data.h"
@@ -509,7 +508,7 @@ namespace mutablebson {
Element makeRootElement(const BSONObj& value);
Element makeElement(ConstElement element, const StringData* fieldName);
- const boost::scoped_ptr<Impl> _impl;
+ const std::unique_ptr<Impl> _impl;
// The root element of this document.
const Element _root;
diff --git a/src/mongo/bson/oid.cpp b/src/mongo/bson/oid.cpp
index e9c6b87eb3a..209d43a8a38 100644
--- a/src/mongo/bson/oid.cpp
+++ b/src/mongo/bson/oid.cpp
@@ -32,7 +32,6 @@
#include "mongo/bson/oid.h"
#include <boost/functional/hash.hpp>
-#include <boost/scoped_ptr.hpp>
#include "mongo/base/init.h"
#include "mongo/bson/bsonobjbuilder.h"
@@ -43,7 +42,7 @@
namespace mongo {
namespace {
- boost::scoped_ptr<AtomicUInt32> counter;
+ std::unique_ptr<AtomicUInt32> counter;
const std::size_t kTimestampOffset = 0;
const std::size_t kInstanceUniqueOffset = kTimestampOffset +
@@ -55,7 +54,7 @@ namespace {
MONGO_INITIALIZER_GENERAL(OIDGeneration, MONGO_NO_PREREQUISITES, ("default"))
(InitializerContext* context) {
- boost::scoped_ptr<SecureRandom> entropy(SecureRandom::create());
+ std::unique_ptr<SecureRandom> entropy(SecureRandom::create());
counter.reset(new AtomicUInt32(uint32_t(entropy->nextInt64())));
_instanceUnique = OID::InstanceUnique::generate(*entropy);
return Status::OK();
@@ -120,7 +119,7 @@ namespace {
}
void OID::regenMachineId() {
- boost::scoped_ptr<SecureRandom> entropy(SecureRandom::create());
+ std::unique_ptr<SecureRandom> entropy(SecureRandom::create());
_instanceUnique = InstanceUnique::generate(*entropy);
}