diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2017-12-21 11:51:28 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-12-21 14:52:49 -0500 |
commit | 92c7b5260795153f4152e8562a7abac3d6d77d8a (patch) | |
tree | 1b058a2162fd352df824a8c470f5c4b222531f71 /Source/cmGlobalVisualStudio14Generator.cxx | |
parent | 258e6f1b1e1d20bc48a5892f5d9d339269fa2704 (diff) | |
download | cmake-92c7b5260795153f4152e8562a7abac3d6d77d8a.tar.gz |
VS: Use range-based 'for' loops in generator code
Use `auto` for complex types.
Diffstat (limited to 'Source/cmGlobalVisualStudio14Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio14Generator.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index 97d5313788..c440e0de66 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -257,9 +257,8 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion() std::vector<std::string> sdks; // Grab the paths of the different SDKs that are installed - for (std::vector<std::string>::iterator i = win10Roots.begin(); - i != win10Roots.end(); ++i) { - std::string path = *i + "/Include/*"; + for (std::string const& i : win10Roots) { + std::string path = i + "/Include/*"; cmSystemTools::GlobDirs(path, sdks); } @@ -269,19 +268,17 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion() if (!sdks.empty()) { // Only use the filename, which will be the SDK version. - for (std::vector<std::string>::iterator i = sdks.begin(); i != sdks.end(); - ++i) { - *i = cmSystemTools::GetFilenameName(*i); + for (std::string& i : sdks) { + i = cmSystemTools::GetFilenameName(i); } // Sort the results to make sure we select the most recent one. std::sort(sdks.begin(), sdks.end(), cmSystemTools::VersionCompareGreater); // Look for a SDK exactly matching the requested target version. - for (std::vector<std::string>::iterator i = sdks.begin(); i != sdks.end(); - ++i) { - if (cmSystemTools::VersionCompareEqual(*i, this->SystemVersion)) { - return *i; + for (std::string const& i : sdks) { + if (cmSystemTools::VersionCompareEqual(i, this->SystemVersion)) { + return i; } } |