diff options
author | Brad King <brad.king@kitware.com> | 2017-09-27 11:24:26 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-09-27 11:25:11 (GMT) |
commit | 068effa4d8ad2813499a6e79b056d79a2120e1ad (patch) | |
tree | 008fcbf88c2f6813542e83fb37a95e45c807b2d4 /Source/cmMakefile.cxx | |
parent | bb371753cb1d35c68060298ae5be6697144c9403 (diff) | |
parent | f0489856e30b1b5236d1897071ea38dfde438fc7 (diff) | |
download | CMake-068effa4d8ad2813499a6e79b056d79a2120e1ad.zip CMake-068effa4d8ad2813499a6e79b056d79a2120e1ad.tar.gz CMake-068effa4d8ad2813499a6e79b056d79a2120e1ad.tar.bz2 |
Merge topic 'auto_ptr'
f0489856 Retire std::auto_ptr and its macro CM_AUTO_PTR
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Pavel Solodovnikov <hellyeahdominate@gmail.com>
Merge-request: !1300
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index e51cfcc..32181cf 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -7,6 +7,7 @@ #include <algorithm> #include <assert.h> #include <ctype.h> +#include <memory> // IWYU pragma: keep #include <sstream> #include <stdlib.h> #include <string.h> @@ -37,7 +38,6 @@ #include "cmTestGenerator.h" // IWYU pragma: keep #include "cmVersion.h" #include "cmWorkingDirectory.h" -#include "cm_auto_ptr.hxx" #include "cm_sys_stat.h" #include "cmake.h" @@ -264,7 +264,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, // Lookup the command prototype. if (cmCommand* proto = this->GetState()->GetCommand(name)) { // Clone the prototype. - CM_AUTO_PTR<cmCommand> pcmd(proto->Clone()); + std::unique_ptr<cmCommand> pcmd(proto->Clone()); pcmd->SetMakefile(this); // Decide whether to invoke the command. @@ -584,11 +584,12 @@ void cmMakefile::EnforceDirectoryLevelRules() const void cmMakefile::AddEvaluationFile( const std::string& inputFile, - CM_AUTO_PTR<cmCompiledGeneratorExpression> outputName, - CM_AUTO_PTR<cmCompiledGeneratorExpression> condition, bool inputIsContent) + std::unique_ptr<cmCompiledGeneratorExpression> outputName, + std::unique_ptr<cmCompiledGeneratorExpression> condition, + bool inputIsContent) { this->EvaluationFiles.push_back(new cmGeneratorExpressionEvaluationFile( - inputFile, outputName, condition, inputIsContent, + inputFile, std::move(outputName), std::move(condition), inputIsContent, this->GetPolicyStatus(cmPolicies::CMP0070))); } @@ -2874,7 +2875,7 @@ void cmMakefile::PopFunctionBlockerBarrier(bool reportError) FunctionBlockersType::size_type barrier = this->FunctionBlockerBarriers.back(); while (this->FunctionBlockers.size() > barrier) { - CM_AUTO_PTR<cmFunctionBlocker> fb(this->FunctionBlockers.back()); + std::unique_ptr<cmFunctionBlocker> fb(this->FunctionBlockers.back()); this->FunctionBlockers.pop_back(); if (reportError) { // Report the context in which the unclosed block was opened. @@ -3009,7 +3010,7 @@ void cmMakefile::AddFunctionBlocker(cmFunctionBlocker* fb) this->FunctionBlockers.push_back(fb); } -CM_AUTO_PTR<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker( +std::unique_ptr<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker( cmFunctionBlocker* fb, const cmListFileFunction& lff) { // Find the function blocker stack barrier for the current scope. @@ -3042,11 +3043,11 @@ CM_AUTO_PTR<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker( } cmFunctionBlocker* b = *pos; this->FunctionBlockers.erase(pos); - return CM_AUTO_PTR<cmFunctionBlocker>(b); + return std::unique_ptr<cmFunctionBlocker>(b); } } - return CM_AUTO_PTR<cmFunctionBlocker>(); + return std::unique_ptr<cmFunctionBlocker>(); } const char* cmMakefile::GetHomeDirectory() const @@ -3703,7 +3704,7 @@ cmTarget* cmMakefile::AddImportedTarget(const std::string& name, bool global) { // Create the target. - CM_AUTO_PTR<cmTarget> target( + std::unique_ptr<cmTarget> target( new cmTarget(name, type, global ? cmTarget::VisibilityImportedGlobally : cmTarget::VisibilityImported, this)); |