cmDepends: Define DependencyMap instead of DependencyVector

In `cmDepends` use
`typedef std::map<std::string, std::vector<std::string>> DependencyMap`
instead of defining a
`class DependencyVector : public std::vector<std::string>`
and using it in `std::map<std::string, DependencyVector>`.

Since `std::map<std::string, std::vector<std::string>>` is used in various
other places, we now reuse all of it's auto generated methods.  This doesn't
happen when we use `DependencyVector` in a `std::map`, because it is a
different class than `std::vector<std::string>`.
This commit is contained in:
Sebastian Holtermann
2019-03-27 15:50:17 +01:00
parent 5a15c9e7cb
commit 87341d8328
8 changed files with 28 additions and 36 deletions
+5 -6
View File
@@ -143,8 +143,7 @@ public:
// File pairs for implicit dependency scanning. The key of the map
// is the depender and the value is the explicit dependee.
struct ImplicitDependFileMap
: public std::map<std::string, cmDepends::DependencyVector>
struct ImplicitDependFileMap : public cmDepends::DependencyMap
{
};
struct ImplicitDependLanguageMap
@@ -230,10 +229,10 @@ protected:
const char* filename = nullptr);
// Helper methods for dependency updates.
bool ScanDependencies(
std::string const& targetDir, std::string const& dependFile,
std::string const& internalDependFile,
std::map<std::string, cmDepends::DependencyVector>& validDeps);
bool ScanDependencies(std::string const& targetDir,
std::string const& dependFile,
std::string const& internalDependFile,
cmDepends::DependencyMap& validDeps);
void CheckMultipleOutputs(bool verbose);
private: