summaryrefslogtreecommitdiffstats
path: root/Source/cmTryRunCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-02-11 13:08:13 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-02-11 13:08:22 (GMT)
commit4b37b4f1bb785a305ab742f37e5268d4cffef693 (patch)
treef9c6e15ac0925bfa8b15fce4c3475d3233a820f6 /Source/cmTryRunCommand.cxx
parent17de1eea806d7ba87a4ba6ad1073ced5f7ea9473 (diff)
parent01b2d6ab7465e7f22fb821876027df86b0c8f363 (diff)
downloadCMake-4b37b4f1bb785a305ab742f37e5268d4cffef693.zip
CMake-4b37b4f1bb785a305ab742f37e5268d4cffef693.tar.gz
CMake-4b37b4f1bb785a305ab742f37e5268d4cffef693.tar.bz2
Merge topic 'modernize-for-loops'
01b2d6ab74 Modernize: Use ranged for-loops when possible 15bdbec017 cmAlgorithms: Make cmRange advance/retreat safe for rvalues Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de> Merge-request: !2901
Diffstat (limited to 'Source/cmTryRunCommand.cxx')
-rw-r--r--Source/cmTryRunCommand.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index fff8f8e..d863339 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -5,6 +5,7 @@
#include "cmsys/FStream.hxx"
#include <stdio.h>
+#include "cmAlgorithms.h"
#include "cmDuration.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
@@ -174,11 +175,9 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs,
finalCommand +=
cmSystemTools::ConvertToRunCommandPath(emulatorWithArgs[0].c_str());
finalCommand += " ";
- for (std::vector<std::string>::const_iterator ei =
- emulatorWithArgs.begin() + 1;
- ei != emulatorWithArgs.end(); ++ei) {
+ for (std::string const& arg : cmMakeRange(emulatorWithArgs).advance(1)) {
finalCommand += "\"";
- finalCommand += *ei;
+ finalCommand += arg;
finalCommand += "\"";
finalCommand += " ";
}