diff options
author | Matthias Maennich <matthias@maennich.net> | 2017-09-21 21:06:05 (GMT) |
---|---|---|
committer | Matthias Maennich <matthias@maennich.net> | 2017-09-25 22:07:19 (GMT) |
commit | f0489856e30b1b5236d1897071ea38dfde438fc7 (patch) | |
tree | f2a786e0c3fe5e9d234f62c3ca3cacfdbd70ef8f /Source/cmMakefile.cxx | |
parent | eae3765b67b653d3f00afa44a60719a387262af8 (diff) | |
download | CMake-f0489856e30b1b5236d1897071ea38dfde438fc7.zip CMake-f0489856e30b1b5236d1897071ea38dfde438fc7.tar.gz CMake-f0489856e30b1b5236d1897071ea38dfde438fc7.tar.bz2 |
Retire std::auto_ptr and its macro CM_AUTO_PTR
Signed-off-by: Matthias Maennich <matthias@maennich.net>
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 c96b892..9b98c47 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 @@ -3747,7 +3748,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)); |