diff options
Diffstat (limited to 'Source/cmCPluginAPI.cxx')
-rw-r--r-- | Source/cmCPluginAPI.cxx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index c0088ac..5efc784 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -491,12 +491,16 @@ public: typedef std::map<cmSourceFile*, cmCPluginAPISourceFile*> derived; typedef derived::iterator iterator; typedef derived::value_type value_type; + cmCPluginAPISourceFileMap() = default; ~cmCPluginAPISourceFileMap() { for (auto const& i : *this) { delete i.second; } } + cmCPluginAPISourceFileMap(const cmCPluginAPISourceFileMap&) = delete; + cmCPluginAPISourceFileMap& operator=(const cmCPluginAPISourceFileMap&) = + delete; }; cmCPluginAPISourceFileMap cmCPluginAPISourceFiles; @@ -683,26 +687,24 @@ void CCONV cmSourceFileSetName(void* arg, const char* name, const char* dir, } // Next, try the various source extensions - for (std::vector<std::string>::const_iterator ext = sourceExts.begin(); - ext != sourceExts.end(); ++ext) { + for (std::string const& ext : sourceExts) { hname = pathname; hname += "."; - hname += *ext; + hname += ext; if (cmSystemTools::FileExists(hname)) { - sf->SourceExtension = *ext; + sf->SourceExtension = ext; sf->FullPath = hname; return; } } // Finally, try the various header extensions - for (std::vector<std::string>::const_iterator ext = headerExts.begin(); - ext != headerExts.end(); ++ext) { + for (std::string const& ext : headerExts) { hname = pathname; hname += "."; - hname += *ext; + hname += ext; if (cmSystemTools::FileExists(hname)) { - sf->SourceExtension = *ext; + sf->SourceExtension = ext; sf->FullPath = hname; return; } @@ -711,13 +713,11 @@ void CCONV cmSourceFileSetName(void* arg, const char* name, const char* dir, std::ostringstream e; e << "Cannot find source file \"" << pathname << "\""; e << "\n\nTried extensions"; - for (std::vector<std::string>::const_iterator ext = sourceExts.begin(); - ext != sourceExts.end(); ++ext) { - e << " ." << *ext; + for (std::string const& ext : sourceExts) { + e << " ." << ext; } - for (std::vector<std::string>::const_iterator ext = headerExts.begin(); - ext != headerExts.end(); ++ext) { - e << " ." << *ext; + for (std::string const& ext : headerExts) { + e << " ." << ext; } cmSystemTools::Error(e.str()); } |