From 87341d8328c7b3a1d50cfd534ff4cb44334a2561 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 27 Mar 2019 15:50:17 +0100 Subject: cmDepends: Define DependencyMap instead of DependencyVector In `cmDepends` use `typedef std::map> DependencyMap` instead of defining a `class DependencyVector : public std::vector` and using it in `std::map`. Since `std::map>` 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`. --- Source/cmDepends.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'Source/cmDepends.h') diff --git a/Source/cmDepends.h b/Source/cmDepends.h index d9d5c67188..b7475f0aef 100644 --- a/Source/cmDepends.h +++ b/Source/cmDepends.h @@ -23,6 +23,9 @@ class cmLocalGenerator; */ class cmDepends { +public: + typedef std::map> DependencyMap; + public: /** Instances need to know the build directory name and the relative path from the build directory to the target file. */ @@ -55,17 +58,13 @@ public: /** Write dependencies for the target file. */ bool Write(std::ostream& makeDepends, std::ostream& internalDepends); - class DependencyVector : public std::vector - { - }; - /** Check dependencies for the target file. Returns true if dependencies are okay and false if they must be generated. If they must be generated Clear has already been called to wipe out the old dependencies. Dependencies which are still valid will be stored in validDeps. */ bool Check(const std::string& makeFile, const std::string& internalFile, - std::map& validDeps); + DependencyMap& validDeps); /** Clear dependencies for the target file so they will be regenerated. */ void Clear(const std::string& file); @@ -84,9 +83,9 @@ protected: // Check dependencies for the target file in the given stream. // Return false if dependencies must be regenerated and true // otherwise. - virtual bool CheckDependencies( - std::istream& internalDepends, const std::string& internalDependsFileName, - std::map& validDeps); + virtual bool CheckDependencies(std::istream& internalDepends, + const std::string& internalDependsFileName, + DependencyMap& validDeps); // Finalize the dependency information for the target. virtual bool Finalize(std::ostream& makeDepends, -- cgit v1.2.1