summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-01-12 13:57:37 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-01-12 13:57:37 (GMT)
commit6c61ffaf9b1616e6938b78ca19f17f9a9f87f3ec (patch)
treecca0a21d897711acddc7679198deb48d82ba8f99 /Source
parent9fced518582afcb0875648a278821f7b82f536f4 (diff)
parent3660d063bc005aa13e7ee4836aef842a91cc87f1 (diff)
downloadCMake-6c61ffaf9b1616e6938b78ca19f17f9a9f87f3ec.zip
CMake-6c61ffaf9b1616e6938b78ca19f17f9a9f87f3ec.tar.gz
CMake-6c61ffaf9b1616e6938b78ca19f17f9a9f87f3ec.tar.bz2
Merge topic 'sun-better-stdlib'
3660d063 cmTarget: Use insert instead of std::copy. 5c28495f Help: Remove documented restriction on template use. ac3d3829 Help: Remove documented restriction on find in conditions. 36b8de56 Help: Remove documented restriction on insert APIs. 6162c919 Use two-iterator std::set::insert where appropriate. 238dd2fb Use insert instead of a loop in some cases. 2f7ef7e3 Revert "Misc. fixes for the Oracle / Sun compiler." 4c69ec6f SolarisStudio: Use alternative standard library to build CMake.
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx7
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx7
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx6
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx22
-rw-r--r--Source/CTest/cmCTestP4.cxx6
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx18
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx18
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx6
-rw-r--r--Source/cmAddTestCommand.cxx6
-rw-r--r--Source/cmCommandArgumentsHelper.cxx9
-rw-r--r--Source/cmComputeLinkDepends.cxx5
-rw-r--r--Source/cmComputeLinkInformation.cxx19
-rw-r--r--Source/cmConditionEvaluator.cxx10
-rw-r--r--Source/cmCustomCommand.cxx13
-rw-r--r--Source/cmDependsC.cxx6
-rw-r--r--Source/cmDependsFortran.cxx10
-rw-r--r--Source/cmExportFileGenerator.cxx6
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx22
-rw-r--r--Source/cmFindBase.cxx6
-rw-r--r--Source/cmFindPackageCommand.cxx15
-rw-r--r--Source/cmFunctionCommand.cxx6
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.cxx4
-rw-r--r--Source/cmGeneratorTarget.cxx12
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx9
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx12
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx6
-rw-r--r--Source/cmInstallFilesCommand.cxx7
-rw-r--r--Source/cmInstallProgramsCommand.cxx6
-rw-r--r--Source/cmLocalGenerator.cxx12
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx9
-rw-r--r--Source/cmMacroCommand.cxx6
-rw-r--r--Source/cmMakefile.cxx25
-rw-r--r--Source/cmMakefileTargetGenerator.cxx36
-rw-r--r--Source/cmQtAutoGenerators.cxx45
-rw-r--r--Source/cmRemoveCommand.cxx5
-rw-r--r--Source/cmSystemTools.cxx6
-rw-r--r--Source/cmTarget.cxx31
37 files changed, 100 insertions, 354 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 7e00027..59c38e9 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -1150,12 +1150,7 @@ void cmCPackWIXGenerator::CollectExtensions(
std::vector<std::string> list;
cmSystemTools::ExpandListArgument(variableContent, list);
-
- for(std::vector<std::string>::const_iterator i = list.begin();
- i != list.end(); ++i)
- {
- extensions.insert(*i);
- }
+ extensions.insert(list.begin(), list.end());
}
void cmCPackWIXGenerator::AddCustomFlags(
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index d226a6c..5e7d764 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -1094,11 +1094,8 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
{
// Create a contiguous array for the line
this->CurrentProcessingLine.clear();
- t_BuildProcessingQueueType::iterator cit;
- for ( cit = queue->begin(); cit != it; ++cit )
- {
- this->CurrentProcessingLine.push_back(*cit);
- }
+ this->CurrentProcessingLine.insert(this->CurrentProcessingLine.end(),
+ queue->begin(), queue->end());
this->CurrentProcessingLine.push_back(0);
const char* line = &*this->CurrentProcessingLine.begin();
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index a1d770b..fb3e367 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -2498,11 +2498,7 @@ void cmCTestCoverageHandler::LoadLabels(const char* dir)
// Label the source with the target labels.
LabelSet& labelSet = this->SourceLabels[source];
- for(std::vector<int>::const_iterator li = targetLabels.begin();
- li != targetLabels.end(); ++li)
- {
- labelSet.insert(*li);
- }
+ labelSet.insert(targetLabels.begin(), targetLabels.end());
}
}
}
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 4c89caa..b83ebe0 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -162,12 +162,9 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test)
//---------------------------------------------------------
void cmCTestMultiProcessHandler::LockResources(int index)
{
- for(std::set<std::string>::iterator i =
- this->Properties[index]->LockedResources.begin();
- i != this->Properties[index]->LockedResources.end(); ++i)
- {
- this->LockedResources.insert(*i);
- }
+ this->LockedResources.insert(
+ this->Properties[index]->LockedResources.begin(),
+ this->Properties[index]->LockedResources.end());
}
//---------------------------------------------------------
@@ -499,11 +496,7 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList()
i != previousSet.end(); ++i)
{
TestSet const& dependencies = this->Tests[*i];
- for(TestSet::const_iterator j = dependencies.begin();
- j != dependencies.end(); ++j)
- {
- currentSet.insert(*j);
- }
+ currentSet.insert(dependencies.begin(), dependencies.end());
}
for(TestSet::const_iterator i = currentSet.begin();
@@ -526,11 +519,8 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList()
TestList sortedCopy;
- for(TestSet::const_iterator j = currentSet.begin();
- j != currentSet.end(); ++j)
- {
- sortedCopy.push_back(*j);
- }
+ sortedCopy.insert(sortedCopy.end(),
+ currentSet.begin(), currentSet.end());
std::stable_sort(sortedCopy.begin(), sortedCopy.end(), comp);
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index 0bb1a99..52b98d7 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -349,11 +349,7 @@ void cmCTestP4::SetP4Options(std::vector<char const*> &CommandOptions)
std::vector<std::string> args =
cmSystemTools::ParseArguments(opts.c_str());
- for(std::vector<std::string>::const_iterator ai = args.begin();
- ai != args.end(); ++ai)
- {
- P4Options.push_back(*ai);
- }
+ P4Options.insert(P4Options.end(), args.begin(), args.end());
}
CommandOptions.clear();
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index 07a994d..4aa8d04 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -74,13 +74,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
std::vector<std::string> notesFiles;
cmCTest::VectorOfStrings newNotesFiles;
cmSystemTools::ExpandListArgument(notesFilesVariable,notesFiles);
- std::vector<std::string>::iterator it;
- for ( it = notesFiles.begin();
- it != notesFiles.end();
- ++ it )
- {
- newNotesFiles.push_back(*it);
- }
+ newNotesFiles.insert(newNotesFiles.end(),
+ notesFiles.begin(), notesFiles.end());
this->CTest->GenerateNotesFile(newNotesFiles);
}
@@ -91,13 +86,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
std::vector<std::string> extraFiles;
cmCTest::VectorOfStrings newExtraFiles;
cmSystemTools::ExpandListArgument(extraFilesVariable,extraFiles);
- std::vector<std::string>::iterator it;
- for ( it = extraFiles.begin();
- it != extraFiles.end();
- ++ it )
- {
- newExtraFiles.push_back(*it);
- }
+ newExtraFiles.insert(newExtraFiles.end(),
+ extraFiles.begin(), extraFiles.end());
if ( !this->CTest->SubmitExtraFiles(newExtraFiles))
{
this->SetError("problem submitting extra files.");
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 6aa1c2b..fea94ba 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -1160,11 +1160,7 @@ int cmCTestSubmitHandler::ProcessHandler()
{
// Submit the explicitly selected files:
//
- cmCTest::SetOfStrings::const_iterator it;
- for (it = this->Files.begin(); it != this->Files.end(); ++it)
- {
- files.insert(*it);
- }
+ files.insert(this->Files.begin(), this->Files.end());
}
// Add to the list of files to submit from any selected, existing parts:
@@ -1219,11 +1215,7 @@ int cmCTestSubmitHandler::ProcessHandler()
// Submit files from this part.
std::vector<std::string> const& pfiles = this->CTest->GetSubmitFiles(p);
- for(std::vector<std::string>::const_iterator pi = pfiles.begin();
- pi != pfiles.end(); ++pi)
- {
- files.insert(*pi);
- }
+ files.insert(pfiles.begin(), pfiles.end());
}
if ( ofs )
@@ -1503,9 +1495,5 @@ void cmCTestSubmitHandler::SelectParts(std::set<cmCTest::Part> const& parts)
//----------------------------------------------------------------------------
void cmCTestSubmitHandler::SelectFiles(cmCTest::SetOfStrings const& files)
{
- cmCTest::SetOfStrings::const_iterator it;
- for (it = files.begin(); it != files.end(); ++it)
- {
- this->Files.insert(*it);
- }
+ this->Files.insert(files.begin(), files.end());
}
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 38ce3dc..0d8d46e 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -2163,11 +2163,7 @@ bool cmCTestTestHandler::SetTestsProperties(
std::vector<std::string> lval;
cmSystemTools::ExpandListArgument(val, lval);
- for(std::vector<std::string>::iterator f = lval.begin();
- f != lval.end(); ++f)
- {
- rtit->LockedResources.insert(*f);
- }
+ rtit->LockedResources.insert(lval.begin(), lval.end());
}
if ( key == "TIMEOUT" )
{
diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx
index 2531a1a..dc3b4c2 100644
--- a/Source/cmAddTestCommand.cxx
+++ b/Source/cmAddTestCommand.cxx
@@ -36,11 +36,7 @@ bool cmAddTestCommand
// Collect the command with arguments.
std::vector<std::string> command;
- for(std::vector<std::string>::const_iterator it = args.begin() + 1;
- it != args.end(); ++it)
- {
- command.push_back(*it);
- }
+ command.insert(command.end(), args.begin() + 1, args.end());
// Create the test but add a generator only the first time it is
// seen. This preserves behavior from before test generators.
diff --git a/Source/cmCommandArgumentsHelper.cxx b/Source/cmCommandArgumentsHelper.cxx
index 1d5fc07..1a2efc6 100644
--- a/Source/cmCommandArgumentsHelper.cxx
+++ b/Source/cmCommandArgumentsHelper.cxx
@@ -50,13 +50,8 @@ void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group)
if (group!=0)
{
this->ArgumentsBeforeEmpty = false;
- for(std::vector<cmCommandArgument*>::const_iterator
- argIt= group->ContainedArguments.begin();
- argIt != group->ContainedArguments.end();
- ++argIt)
- {
- this->ArgumentsBefore.insert(*argIt);
- }
+ this->ArgumentsBefore.insert(group->ContainedArguments.begin(),
+ group->ContainedArguments.end());
}
}
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index a636d23..1fb8f30 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -266,10 +266,9 @@ cmComputeLinkDepends::Compute()
// Iterate in reverse order so we can keep only the last occurrence
// of a shared library.
std::set<int> emmitted;
- const std::vector<int>& cFLO = this->FinalLinkOrder;
for(std::vector<int>::const_reverse_iterator
- li = cFLO.rbegin(),
- le = cFLO.rend();
+ li = this->FinalLinkOrder.rbegin(),
+ le = this->FinalLinkOrder.rend();
li != le; ++li)
{
int i = *li;
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index f4fa5c6..7171d6b 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -408,11 +408,7 @@ cmComputeLinkInformation
// Construct a mask to not bother with this behavior for link
// directories already specified by the user.
std::vector<std::string> const& dirs = this->Target->GetLinkDirectories();
- for(std::vector<std::string>::const_iterator di = dirs.begin();
- di != dirs.end(); ++di)
- {
- this->OldLinkDirMask.insert(*di);
- }
+ this->OldLinkDirMask.insert(dirs.begin(), dirs.end());
}
}
@@ -1420,11 +1416,8 @@ void cmComputeLinkInformation::ComputeFrameworkInfo()
cmSystemTools::ExpandListArgument(implicitDirs, implicitDirVec);
}
- for(std::vector<std::string>::const_iterator i = implicitDirVec.begin();
- i != implicitDirVec.end(); ++i)
- {
- this->FrameworkPathsEmmitted.insert(*i);
- }
+ this->FrameworkPathsEmmitted.insert(implicitDirVec.begin(),
+ implicitDirVec.end());
// Regular expression to extract a framework path and name.
this->SplitFramework.compile("(.*)/(.*)\\.framework$");
@@ -1694,11 +1687,7 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo()
}
// Store implicit link directories.
- for(std::vector<std::string>::const_iterator i = implicitDirVec.begin();
- i != implicitDirVec.end(); ++i)
- {
- this->ImplicitLinkDirs.insert(*i);
- }
+ this->ImplicitLinkDirs.insert(implicitDirVec.begin(), implicitDirVec.end());
// Get language-specific implicit libraries.
std::vector<std::string> implicitLibVec;
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index aba26de..7a601e2 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -53,10 +53,7 @@ bool cmConditionEvaluator::IsTrue(
cmArgumentList newArgs;
// copy to the list structure
- for(unsigned int i = 0; i < args.size(); ++i)
- {
- newArgs.push_back(args[i]);
- }
+ newArgs.insert(newArgs.end(), args.begin(), args.end());
// now loop through the arguments and see if we can reduce any of them
// we do this multiple times. Once for each level of precedence
@@ -411,10 +408,7 @@ bool cmConditionEvaluator::HandleLevel0(cmArgumentList &newArgs,
// copy to the list structure
cmArgumentList::iterator argP1 = arg;
argP1++;
- for(; argP1 != argClose; argP1++)
- {
- newArgs2.push_back(*argP1);
- }
+ newArgs2.insert(newArgs2.end(), argP1, argClose);
newArgs2.pop_back();
// now recursively invoke IsTrue to handle the values inside the
// parenthetical expression
diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx
index 2afb029..015825d 100644
--- a/Source/cmCustomCommand.cxx
+++ b/Source/cmCustomCommand.cxx
@@ -131,21 +131,14 @@ const char* cmCustomCommand::GetComment() const
//----------------------------------------------------------------------------
void cmCustomCommand::AppendCommands(const cmCustomCommandLines& commandLines)
{
- for(cmCustomCommandLines::const_iterator i=commandLines.begin();
- i != commandLines.end(); ++i)
- {
- this->CommandLines.push_back(*i);
- }
+ this->CommandLines.insert(this->CommandLines.end(),
+ commandLines.begin(), commandLines.end());
}
//----------------------------------------------------------------------------
void cmCustomCommand::AppendDepends(const std::vector<std::string>& depends)
{
- for(std::vector<std::string>::const_iterator i=depends.begin();
- i != depends.end(); ++i)
- {
- this->Depends.push_back(*i);
- }
+ this->Depends.insert(this->Depends.end(), depends.begin(), depends.end());
}
//----------------------------------------------------------------------------
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index a1fc268..a8711eb 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -125,11 +125,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
this->ValidDeps->find(obj);
if (tmpIt!= this->ValidDeps->end())
{
- for(DependencyVector::const_iterator i=tmpIt->second.begin();
- i != tmpIt->second.end(); ++i)
- {
- dependencies.insert(*i);
- }
+ dependencies.insert(tmpIt->second.begin(), tmpIt->second.end());
haveDeps = true;
}
}
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 4082d24..d9818ce 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -319,17 +319,13 @@ void cmDependsFortran::LocateModules()
infoI != objInfo.end(); ++infoI)
{
cmDependsFortranSourceInfo const& info = infoI->second;
- for(std::set<std::string>::const_iterator i = info.Provides.begin();
- i != info.Provides.end(); ++i)
- {
- // Include this module in the set provided by this target.
- this->Internal->TargetProvides.insert(*i);
- }
+ // Include this module in the set provided by this target.
+ this->Internal->TargetProvides.insert(info.Provides.begin(),
+ info.Provides.end());
for(std::set<std::string>::const_iterator i = info.Requires.begin();
i != info.Requires.end(); ++i)
{
- // Include this module in the set required by this target.
this->Internal->TargetRequires[*i] = "";
}
}
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 1f39d7a..2b81d60 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -456,11 +456,7 @@ void getPropertyContents(cmTarget const* tgt, const std::string& prop,
}
std::vector<std::string> content;
cmSystemTools::ExpandListArgument(p, content);
- for (std::vector<std::string>::const_iterator ci = content.begin();
- ci != content.end(); ++ci)
- {
- ifaceProperties.insert(*ci);
- }
+ ifaceProperties.insert(content.begin(), content.end());
}
//----------------------------------------------------------------------------
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 79d7bcaff..69857ef 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -615,12 +615,8 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
std::vector<std::string> includes;
target->GetMakefile()->GetLocalGenerator()->
GetIncludeDirectories(includes, gtgt, "C", buildType);
- for(std::vector<std::string>::const_iterator dirIt=includes.begin();
- dirIt != includes.end();
- ++dirIt)
- {
- uniqIncludeDirs.insert(*dirIt);
- }
+
+ uniqIncludeDirs.insert(includes.begin(), includes.end());
std::string systemIncludeDirs = makefile->GetSafeDefinition(
"CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
@@ -628,12 +624,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
{
std::vector<std::string> dirs;
cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs);
- for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
- dirIt != dirs.end();
- ++dirIt)
- {
- uniqIncludeDirs.insert(*dirIt);
- }
+ uniqIncludeDirs.insert(dirs.begin(), dirs.end());
}
systemIncludeDirs = makefile->GetSafeDefinition(
@@ -642,12 +633,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
{
std::vector<std::string> dirs;
cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs);
- for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
- dirIt != dirs.end();
- ++dirIt)
- {
- uniqIncludeDirs.insert(*dirIt);
- }
+ uniqIncludeDirs.insert(dirs.begin(), dirs.end());
}
for(std::set<std::string>::const_iterator dirIt=uniqIncludeDirs.begin();
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index beb6dde..013724e 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -184,10 +184,8 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
std::vector<std::string> shortArgs = this->Names;
this->Names.clear(); // clear out any values in Names
this->Names.push_back(shortArgs[0]);
- for(unsigned int j = 1; j < shortArgs.size(); ++j)
- {
- this->UserGuessArgs.push_back(shortArgs[j]);
- }
+ this->UserGuessArgs.insert(this->UserGuessArgs.end(),
+ shortArgs.begin() + 1, shortArgs.end());
}
this->ExpandPaths();
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 8410cda..0130006 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -80,15 +80,12 @@ void cmFindPackageCommand::AppendSearchPathGroups()
PathLabel::SystemRegistry);
// Create the new path objects
- this->LabeledPaths.insert(
- std::pair<cmFindCommon::PathLabel, cmSearchPath>(
- PathLabel::UserRegistry, cmSearchPath(this)));
- this->LabeledPaths.insert(
- std::pair<cmFindCommon::PathLabel, cmSearchPath>(
- PathLabel::Builds, cmSearchPath(this)));
- this->LabeledPaths.insert(
- std::pair<cmFindCommon::PathLabel, cmSearchPath>(
- PathLabel::SystemRegistry, cmSearchPath(this)));
+ this->LabeledPaths.insert(std::make_pair(PathLabel::UserRegistry,
+ cmSearchPath(this)));
+ this->LabeledPaths.insert(std::make_pair(PathLabel::Builds,
+ cmSearchPath(this)));
+ this->LabeledPaths.insert(std::make_pair(PathLabel::SystemRegistry,
+ cmSearchPath(this)));
}
//----------------------------------------------------------------------------
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 3580374..488538f 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -271,11 +271,7 @@ bool cmFunctionCommand
// create a function blocker
cmFunctionFunctionBlocker *f = new cmFunctionFunctionBlocker();
- for(std::vector<std::string>::const_iterator j = args.begin();
- j != args.end(); ++j)
- {
- f->Args.push_back(*j);
- }
+ f->Args.insert(f->Args.end(), args.begin(), args.end());
this->Makefile->AddFunctionBlocker(f);
return true;
}
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 75a84cb..a660bd4 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -66,9 +66,7 @@ cmGeneratorExpressionDAGChecker::Initialize()
if (it != top->Seen.end())
{
const std::set<std::string> &propSet = it->second;
- const std::set<std::string>::const_iterator i
- = propSet.find(this->Property);
- if (i != propSet.end())
+ if (propSet.find(this->Property) != propSet.end())
{
this->CheckResult = ALREADY_SEEN;
return;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 2b531e2..56213e9 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -489,11 +489,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
unique.insert(*li);
}
result.clear();
- for(std::set<std::string>::iterator li = unique.begin();
- li != unique.end(); ++li)
- {
- result.push_back(*li);
- }
+ result.insert(result.end(), unique.begin(), unique.end());
IncludeCacheType::value_type entry(config_upper, result);
iter = this->SystemIncludesCache.insert(entry).first;
@@ -822,11 +818,7 @@ cmTargetTraceDependencies
= ge.Parse(*cli);
cge->Evaluate(this->Makefile, "", true);
std::set<cmTarget*> geTargets = cge->GetTargets();
- for(std::set<cmTarget*>::const_iterator it = geTargets.begin();
- it != geTargets.end(); ++it)
- {
- targets.insert(*it);
- }
+ targets.insert(geTargets.begin(), geTargets.end());
}
}
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 6f0586b..07ea942 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1021,12 +1021,9 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
}
//insert outputs from all WirteBuild commands
- for(std::set<std::string>::iterator i = this->CombinedBuildOutputs.begin();
- i != this->CombinedBuildOutputs.end(); ++i)
- {
- //these paths have already be encoded when added to CombinedBuildOutputs
- knownDependencies.insert(*i);
- }
+ //these paths have already be encoded when added to CombinedBuildOutputs
+ knownDependencies.insert(this->CombinedBuildOutputs.begin(),
+ this->CombinedBuildOutputs.end());
//after we have combined the data into knownDependencies we have no need
//to keep this data around
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 2dab23c..320a1f4 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -845,22 +845,14 @@ cmGlobalVisualStudioGenerator::TargetCompare
cmGlobalVisualStudioGenerator::OrderedTargetDependSet
::OrderedTargetDependSet(TargetDependSet const& targets)
{
- for(TargetDependSet::const_iterator ti =
- targets.begin(); ti != targets.end(); ++ti)
- {
- this->insert(*ti);
- }
+ this->insert(targets.begin(), targets.end());
}
//----------------------------------------------------------------------------
cmGlobalVisualStudioGenerator::OrderedTargetDependSet
::OrderedTargetDependSet(TargetSet const& targets)
{
- for(TargetSet::const_iterator ti = targets.begin();
- ti != targets.end(); ++ti)
- {
- this->insert(*ti);
- }
+ this->insert(targets.begin(), targets.end());
}
std::string cmGlobalVisualStudioGenerator::ExpandCFGIntDir(
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index df5508e..f37d8bc 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -71,11 +71,7 @@ bool cmIncludeDirectoryCommand
}
if (system)
{
- for (std::vector<std::string>::const_iterator li = includes.begin();
- li != includes.end(); ++li)
- {
- systemIncludes.insert(*li);
- }
+ systemIncludes.insert(includes.begin(), includes.end());
}
}
std::reverse(beforeIncludes.begin(), beforeIncludes.end());
diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx
index f106e1a..a007693 100644
--- a/Source/cmInstallFilesCommand.cxx
+++ b/Source/cmInstallFilesCommand.cxx
@@ -47,11 +47,8 @@ bool cmInstallFilesCommand
else
{
this->IsFilesForm = false;
- std::vector<std::string>::const_iterator s = args.begin();
- for (++s;s != args.end(); ++s)
- {
- this->FinalArgs.push_back(*s);
- }
+ this->FinalArgs.insert(this->FinalArgs.end(),
+ args.begin() + 1, args.end());
}
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx
index 0405769..cc223ab 100644
--- a/Source/cmInstallProgramsCommand.cxx
+++ b/Source/cmInstallProgramsCommand.cxx
@@ -27,11 +27,7 @@ bool cmInstallProgramsCommand
this->Destination = args[0];
- std::vector<std::string>::const_iterator s = args.begin();
- for (++s;s != args.end(); ++s)
- {
- this->FinalArgs.push_back(*s);
- }
+ this->FinalArgs.insert(this->FinalArgs.end(), args.begin() + 1, args.end());
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
->AddInstallComponent(this->Makefile->GetSafeDefinition(
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 2de6c93..a4185ad 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -634,11 +634,7 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
// Parse the string to get the custom command line.
cmCustomCommandLine commandLine;
std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str());
- for(std::vector<std::string>::iterator a = cmd.begin();
- a != cmd.end(); ++a)
- {
- commandLine.push_back(*a);
- }
+ commandLine.insert(commandLine.end(), cmd.begin(), cmd.end());
// Store this command line.
commandLines.push_back(commandLine);
@@ -745,11 +741,7 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
// Parse the string to get the custom command line.
cmCustomCommandLine commandLine;
std::vector<std::string> cmd = cmSystemTools::ParseArguments(i->c_str());
- for(std::vector<std::string>::iterator a = cmd.begin();
- a != cmd.end(); ++a)
- {
- commandLine.push_back(*a);
- }
+ commandLine.insert(commandLine.end(), cmd.begin(), cmd.end());
// Store this command line.
commandLines.push_back(commandLine);
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 812ded3..96beb1c 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1856,13 +1856,8 @@ void cmLocalUnixMakefileGenerator3
{
text = "Running external command ...";
}
- std::set<std::string>::const_iterator dit;
- for ( dit = glIt->second.GetUtilities().begin();
- dit != glIt->second.GetUtilities().end();
- ++ dit )
- {
- depends.push_back(*dit);
- }
+ depends.insert(depends.end(), glIt->second.GetUtilities().begin(),
+ glIt->second.GetUtilities().end());
this->AppendEcho(commands, text,
cmLocalUnixMakefileGenerator3::EchoGlobal);
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index ae81c58..d399313 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -328,11 +328,7 @@ bool cmMacroCommand::InitialPass(std::vector<std::string> const& args,
// create a function blocker
cmMacroFunctionBlocker *f = new cmMacroFunctionBlocker();
- for(std::vector<std::string>::const_iterator j = args.begin();
- j != args.end(); ++j)
- {
- f->Args.push_back(*j);
- }
+ f->Args.insert(f->Args.end(), args.begin(), args.end());
this->Makefile->AddFunctionBlocker(f);
return true;
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 20dae5a..25d23f7 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1822,11 +1822,7 @@ void cmMakefile::AddIncludeDirectories(const std::vector<std::string> &incs,
void
cmMakefile::AddSystemIncludeDirectories(const std::set<std::string> &incs)
{
- for(std::set<std::string>::const_iterator li = incs.begin();
- li != incs.end(); ++li)
- {
- this->SystemIncludeDirectories.insert(*li);
- }
+ this->SystemIncludeDirectories.insert(incs.begin(), incs.end());
for (cmTargets::iterator l = this->Targets.begin();
l != this->Targets.end(); ++l)
@@ -2567,12 +2563,7 @@ std::vector<std::string> cmMakefile
}
std::vector<std::string> res;
-
- std::set<std::string>::iterator fit;
- for ( fit = definitions.begin(); fit != definitions.end(); fit ++ )
- {
- res.push_back(*fit);
- }
+ res.insert(res.end(), definitions.begin(), definitions.end());
return res;
}
@@ -4561,16 +4552,8 @@ void cmMakefile::PopScope()
this->Internal->VarInitStack.pop();
this->Internal->VarUsageStack.pop();
// Push initialization and usage up to the parent scope.
- it = init.begin();
- for (; it != init.end(); ++it)
- {
- this->Internal->VarInitStack.top().insert(*it);
- }
- it = usage.begin();
- for (; it != usage.end(); ++it)
- {
- this->Internal->VarUsageStack.top().insert(*it);
- }
+ this->Internal->VarInitStack.top().insert(init.begin(), init.end());
+ this->Internal->VarUsageStack.top().insert(usage.begin(), usage.end());
}
void cmMakefile::RaiseScope(const std::string& var, const char *varDef)
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index cbf8573..040a7d6 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -759,13 +759,10 @@ cmMakefileTargetGenerator
if(const char* extra_outputs_str =
source.GetProperty("OBJECT_OUTPUTS"))
{
+ // Register these as extra files to clean.
cmSystemTools::ExpandListArgument(extra_outputs_str, outputs);
- for(std::vector<std::string>::const_iterator eoi = outputs.begin()+1;
- eoi != outputs.end(); ++eoi)
- {
- // Register this as an extra file to clean.
- this->CleanFiles.push_back(*eoi);
- }
+ this->CleanFiles.insert(this->CleanFiles.end(),
+ outputs.begin() + 1, outputs.end());
}
// Write the rule.
@@ -1174,11 +1171,7 @@ cmMakefileTargetGenerator
{
cmCustomCommandGenerator ccg(*cc, this->ConfigName, this->Makefile);
const std::vector<std::string>& outputs = ccg.GetOutputs();
- for(std::vector<std::string>::const_iterator o = outputs.begin();
- o != outputs.end(); ++o)
- {
- depends.push_back(*o);
- }
+ depends.insert(depends.end(), outputs.begin(), outputs.end());
}
}
}
@@ -1462,11 +1455,8 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(
}
// Make sure the extra files are built.
- for(std::set<std::string>::const_iterator i = this->ExtraFiles.begin();
- i != this->ExtraFiles.end(); ++i)
- {
- depends.push_back(*i);
- }
+ depends.insert(depends.end(),
+ this->ExtraFiles.begin(), this->ExtraFiles.end());
}
// Write the driver rule.
@@ -1553,11 +1543,7 @@ void cmMakefileTargetGenerator
if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
{
std::vector<std::string> const& libDeps = cli->GetDepends();
- for(std::vector<std::string>::const_iterator j = libDeps.begin();
- j != libDeps.end(); ++j)
- {
- depends.push_back(*j);
- }
+ depends.insert(depends.end(), libDeps.begin(), libDeps.end());
}
}
@@ -1577,12 +1563,8 @@ void cmMakefileTargetGenerator
}
// Add dependencies on the external object files.
- for(std::vector<std::string>::const_iterator obj
- = this->ExternalObjects.begin();
- obj != this->ExternalObjects.end(); ++obj)
- {
- depends.push_back(*obj);
- }
+ depends.insert(depends.end(),
+ this->ExternalObjects.begin(), this->ExternalObjects.end());
// Add a dependency on the rule file itself.
this->LocalGenerator->AppendRuleDepend(depends,
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index a01a384..ded85c3 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -899,12 +899,7 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
std::set<std::string> skipped;
std::vector<std::string> skipVec;
cmSystemTools::ExpandListArgument(this->SkipUic, skipVec);
-
- for (std::vector<std::string>::const_iterator li = skipVec.begin();
- li != skipVec.end(); ++li)
- {
- skipped.insert(*li);
- }
+ skipped.insert(skipVec.begin(), skipVec.end());
makefile->AddDefinition("_skip_uic",
cmLocalGenerator::EscapeForCMake(this->SkipUic).c_str());
@@ -1622,12 +1617,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile)
std::vector<std::string> headerFilesVec;
cmSystemTools::ExpandListArgument(this->Headers, headerFilesVec);
- for (std::vector<std::string>::const_iterator it = headerFilesVec.begin();
- it != headerFilesVec.end();
- ++it)
- {
- headerFiles.insert(*it);
- }
+ headerFiles.insert(headerFilesVec.begin(), headerFilesVec.end());
// key = moc source filepath, value = moc output filename
std::map<std::string, std::string> notIncludedMocs;
@@ -2188,24 +2178,12 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
std::vector<std::string> command;
command.push_back(this->MocExecutable);
- for (std::list<std::string>::const_iterator it = this->MocIncludes.begin();
- it != this->MocIncludes.end();
- ++it)
- {
- command.push_back(*it);
- }
- for(std::list<std::string>::const_iterator it=this->MocDefinitions.begin();
- it != this->MocDefinitions.end();
- ++it)
- {
- command.push_back(*it);
- }
- for(std::vector<std::string>::const_iterator it=this->MocOptions.begin();
- it != this->MocOptions.end();
- ++it)
- {
- command.push_back(*it);
- }
+ command.insert(command.end(),
+ this->MocIncludes.begin(), this->MocIncludes.end());
+ command.insert(command.end(),
+ this->MocDefinitions.begin(), this->MocDefinitions.end());
+ command.insert(command.end(),
+ this->MocOptions.begin(), this->MocOptions.end());
#ifdef _WIN32
command.push_back("-DWIN32");
#endif
@@ -2277,12 +2255,7 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& realName,
cmSystemTools::ExpandListArgument(optionIt->second, fileOpts);
this->MergeUicOptions(opts, fileOpts, this->QtMajorVersion == "5");
}
- for(std::vector<std::string>::const_iterator optIt = opts.begin();
- optIt != opts.end();
- ++optIt)
- {
- command.push_back(*optIt);
- }
+ command.insert(command.end(), opts.begin(), opts.end());
command.push_back("-o");
command.push_back(this->Builddir + ui_output_file);
diff --git a/Source/cmRemoveCommand.cxx b/Source/cmRemoveCommand.cxx
index bcb8564..d8aa1cb 100644
--- a/Source/cmRemoveCommand.cxx
+++ b/Source/cmRemoveCommand.cxx
@@ -39,10 +39,7 @@ bool cmRemoveCommand
// check for REMOVE(VAR v1 v2 ... vn)
std::vector<std::string> argsExpanded;
std::vector<std::string> temp;
- for(unsigned int j = 1; j < args.size(); ++j)
- {
- temp.push_back(args[j]);
- }
+ temp.insert(temp.end(), args.begin() + 1, args.end());
cmSystemTools::ExpandList(temp, argsExpanded);
// now create the new value
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 1c8c387..54dafd2 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1273,11 +1273,7 @@ bool cmSystemTools::Split(const char* s, std::vector<std::string>& l)
{
std::vector<std::string> temp;
bool res = Superclass::Split(s, temp);
- for(std::vector<std::string>::const_iterator i = temp.begin();
- i != temp.end(); ++i)
- {
- l.push_back(*i);
- }
+ l.insert(l.end(), temp.begin(), temp.end());
return res;
}
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 94a6de3..d454e89 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -424,12 +424,8 @@ void cmTarget::SetMakefile(cmMakefile* mf)
const std::set<std::string> parentSystemIncludes =
this->Makefile->GetSystemIncludeDirectories();
- for (std::set<std::string>::const_iterator it
- = parentSystemIncludes.begin();
- it != parentSystemIncludes.end(); ++it)
- {
- this->SystemIncludeDirectories.insert(*it);
- }
+ this->SystemIncludeDirectories.insert(parentSystemIncludes.begin(),
+ parentSystemIncludes.end());
const std::vector<cmValueWithOrigin> parentOptions =
this->Makefile->GetCompileOptionsEntries();
@@ -1397,22 +1393,14 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
void
cmTarget::AddSystemIncludeDirectories(const std::set<std::string> &incs)
{
- for(std::set<std::string>::const_iterator li = incs.begin();
- li != incs.end(); ++li)
- {
- this->SystemIncludeDirectories.insert(*li);
- }
+ this->SystemIncludeDirectories.insert(incs.begin(), incs.end());
}
//----------------------------------------------------------------------------
void
cmTarget::AddSystemIncludeDirectories(const std::vector<std::string> &incs)
{
- for(std::vector<std::string>::const_iterator li = incs.begin();
- li != incs.end(); ++li)
- {
- this->SystemIncludeDirectories.insert(*li);
- }
+ this->SystemIncludeDirectories.insert(incs.begin(), incs.end());
}
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -6070,8 +6058,8 @@ cmTargetInternals::ComputeLinkInterfaceLibraries(
// The link implementation is the default link interface.
cmTarget::LinkImplementationLibraries const* impl =
thisTarget->GetLinkImplementationLibrariesInternal(config, headTarget);
- std::copy(impl->Libraries.begin(), impl->Libraries.end(),
- std::back_inserter(iface.Libraries));
+ iface.Libraries.insert(iface.Libraries.end(),
+ impl->Libraries.begin(), impl->Libraries.end());
if(thisTarget->PolicyStatusCMP0022 == cmPolicies::WARN &&
!this->PolicyWarnedCMP0022 && !usage_requirements_only)
{
@@ -6449,11 +6437,8 @@ cmTargetInternals::ComputeLinkImplementationLanguages(
// Get languages used in our source files.
thisTarget->GetLanguages(languages, config);
// Copy the set of langauges to the link implementation.
- for(std::set<std::string>::iterator li = languages.begin();
- li != languages.end(); ++li)
- {
- impl.Languages.push_back(*li);
- }
+ impl.Languages.insert(impl.Languages.begin(),
+ languages.begin(), languages.end());
}
//----------------------------------------------------------------------------