summaryrefslogtreecommitdiff
path: root/src/mongo/util/options_parser/option_section.cpp
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2015-06-10 17:43:13 -0400
committerAndrew Morrow <acm@mongodb.com>2015-06-10 22:37:44 -0400
commita9b6612f5322f916298c19a6728817a1034c6aab (patch)
tree0da5b1ce36e6a8e2d85dbdeb49d505ac99bf6e1d /src/mongo/util/options_parser/option_section.cpp
parent0ec1e625760eb9c1a20a3dba78200e8f9ff28d9e (diff)
downloadmongo-a9b6612f5322f916298c19a6728817a1034c6aab.tar.gz
SERVER-17309 Replace std::auto_ptr<T> with std::unique_ptr<T>
Diffstat (limited to 'src/mongo/util/options_parser/option_section.cpp')
-rw-r--r--src/mongo/util/options_parser/option_section.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mongo/util/options_parser/option_section.cpp b/src/mongo/util/options_parser/option_section.cpp
index 1e31ce44374..5d3646554ee 100644
--- a/src/mongo/util/options_parser/option_section.cpp
+++ b/src/mongo/util/options_parser/option_section.cpp
@@ -140,10 +140,10 @@ namespace optionenvironment {
* those conversions are inconsistent with our own. See SERVER-14110 For an example.
*/
template <typename Type>
- Status typeToBoostStringType(std::auto_ptr<po::value_semantic>* boostType,
+ Status typeToBoostStringType(std::unique_ptr<po::value_semantic>* boostType,
const Value defaultValue = Value(),
const Value implicitValue = Value()) {
- std::auto_ptr<po::typed_value<std::string> >
+ std::unique_ptr<po::typed_value<std::string> >
boostTypeBuilder(po::value<std::string>());
if (!implicitValue.isEmpty()) {
@@ -172,7 +172,7 @@ namespace optionenvironment {
boostTypeBuilder->default_value(sb.str());
}
- *boostType = boostTypeBuilder;
+ *boostType = std::move(boostTypeBuilder);
return Status::OK();
}
@@ -180,7 +180,7 @@ namespace optionenvironment {
/** Helper function to convert the values of our OptionType enum into the classes that
* boost::program_option uses to pass around this information
*/
- Status typeToBoostType(std::auto_ptr<po::value_semantic>* boostType,
+ Status typeToBoostType(std::unique_ptr<po::value_semantic>* boostType,
OptionType type,
const Value defaultValue = Value(),
const Value implicitValue = Value(),
@@ -188,7 +188,7 @@ namespace optionenvironment {
switch (type) {
case StringVector:
{
- *boostType = std::auto_ptr<po::value_semantic>(
+ *boostType = std::unique_ptr<po::value_semantic>(
po::value< std::vector<std::string> >());
if (!implicitValue.isEmpty()) {
@@ -209,7 +209,7 @@ namespace optionenvironment {
{
// Boost doesn't support maps, so we just register a vector parameter and
// parse it as "key=value" strings
- *boostType = std::auto_ptr<po::value_semantic>(
+ *boostType = std::unique_ptr<po::value_semantic>(
po::value< std::vector<std::string> >());
if (!implicitValue.isEmpty()) {
@@ -236,19 +236,19 @@ namespace optionenvironment {
// whether we are telling boost that an option is a switch type or that an
// option is a bool type.
if (!getSwitchAsBool) {
- *boostType = std::auto_ptr<po::value_semantic>(po::bool_switch());
+ *boostType = std::unique_ptr<po::value_semantic>(po::bool_switch());
return Status::OK();
}
else {
// Switches should be true if they are present with no explicit value.
- *boostType = std::auto_ptr<po::typed_value<bool> >(po::value<bool>()
+ *boostType = std::unique_ptr<po::typed_value<bool> >(po::value<bool>()
->implicit_value(true));
return Status::OK();
}
}
case Bool:
{
- std::auto_ptr<po::typed_value<bool> > boostTypeBuilder(po::value<bool>());
+ std::unique_ptr<po::typed_value<bool> > boostTypeBuilder(po::value<bool>());
if (!implicitValue.isEmpty()) {
bool implicitValueType;
@@ -272,7 +272,7 @@ namespace optionenvironment {
boostTypeBuilder->default_value(defaultValueType);
}
- *boostType = boostTypeBuilder;
+ *boostType = std::move(boostTypeBuilder);
return Status::OK();
}
@@ -312,7 +312,7 @@ namespace optionenvironment {
// either visible or we are requesting hidden options
if ((!visibleOnly || (oditerator->_isVisible)) &&
(oditerator->_sources & sources)) {
- std::auto_ptr<po::value_semantic> boostType;
+ std::unique_ptr<po::value_semantic> boostType;
Status ret = typeToBoostType(&boostType,
oditerator->_type,
includeDefaults ? oditerator->_default : Value(),