diff options
author | Artur Ryt <artur.ryt@gmail.com> | 2019-02-07 21:39:05 (GMT) |
---|---|---|
committer | Artur Ryt <artur.ryt@gmail.com> | 2019-02-07 21:39:05 (GMT) |
commit | 01b2d6ab7465e7f22fb821876027df86b0c8f363 (patch) | |
tree | 7ae313670e3655269ef7f9db6feabdc4bb2aaf25 /Source/cmAddDependenciesCommand.cxx | |
parent | 15bdbec0176e3aa620bb5bda3631819c5ca18eaf (diff) | |
download | CMake-01b2d6ab7465e7f22fb821876027df86b0c8f363.zip CMake-01b2d6ab7465e7f22fb821876027df86b0c8f363.tar.gz CMake-01b2d6ab7465e7f22fb821876027df86b0c8f363.tar.bz2 |
Modernize: Use ranged for-loops when possible
Replaced most manual `const_iterator`-based loops and some
reverse-iterator loops with range loops.
Fixes: #18858
Diffstat (limited to 'Source/cmAddDependenciesCommand.cxx')
-rw-r--r-- | Source/cmAddDependenciesCommand.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx index 021bd29..1023808 100644 --- a/Source/cmAddDependenciesCommand.cxx +++ b/Source/cmAddDependenciesCommand.cxx @@ -4,6 +4,7 @@ #include <sstream> +#include "cmAlgorithms.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmTarget.h" @@ -27,10 +28,10 @@ bool cmAddDependenciesCommand::InitialPass( this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str()); } if (cmTarget* target = this->Makefile->FindTargetToUse(target_name)) { - std::vector<std::string>::const_iterator s = args.begin(); - ++s; // skip over target_name - for (; s != args.end(); ++s) { - target->AddUtility(*s, this->Makefile); + + // skip over target_name + for (std::string const& arg : cmMakeRange(args).advance(1)) { + target->AddUtility(arg, this->Makefile); } } else { std::ostringstream e; |