diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2022-07-05 00:39:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-08-02 13:46:52 (GMT) |
commit | 664abd486f5db0000c44c274ec6af10f4f079a44 (patch) | |
tree | 8cb61c3aabe2286c267527076b37c948a42907aa /Source/cmFindPackageCommand.cxx | |
parent | c862797a40f851284053985596650322356e1326 (diff) | |
download | CMake-664abd486f5db0000c44c274ec6af10f4f079a44.zip CMake-664abd486f5db0000c44c274ec6af10f4f079a44.tar.gz CMake-664abd486f5db0000c44c274ec6af10f4f079a44.tar.bz2 |
cmFindPackageCommand: Better names for template parameters
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 7450edf..ef7c49c 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -381,34 +381,37 @@ void ResetGenerator() { } -template <typename T> -void ResetGenerator(T&& g) +template <typename Generator> +void ResetGenerator(Generator&& generator) { - std::forward<T&&>(g).Reset(); + std::forward<Generator&&>(generator).Reset(); } -template <typename T, typename... Ts> -void ResetGenerator(T&& g, Ts&&... tail) +template <typename Generator, typename... Generators> +void ResetGenerator(Generator&& generator, Generators&&... generators) { - ResetGenerator(std::forward<T&&>(g)); - ResetGenerator(std::forward<Ts&&>(tail)...); + ResetGenerator(std::forward<Generator&&>(generator)); + ResetGenerator(std::forward<Generators&&>(generators)...); } -template <typename Fn> -bool TryGeneratedPaths(Fn&& checker, const std::string& fullPath) +template <typename CallbackFn> +bool TryGeneratedPaths(CallbackFn&& filesCollector, + const std::string& fullPath) { assert(!fullPath.empty() && fullPath.back() != '/'); - return std::forward<Fn&&>(checker)(fullPath + '/'); + return std::forward<CallbackFn&&>(filesCollector)(fullPath + '/'); } -template <typename Fn, typename Generator, typename... Rest> -bool TryGeneratedPaths(Fn&& checker, const std::string& startPath, - Generator&& gen, Rest&&... tail) +template <typename CallbackFn, typename Generator, typename... Rest> +bool TryGeneratedPaths(CallbackFn&& filesCollector, + const std::string& startPath, Generator&& gen, + Rest&&... tail) { + ResetGenerator(std::forward<Generator&&>(gen)); for (auto path = gen.GetNextCandidate(startPath); !path.empty(); path = gen.GetNextCandidate(startPath)) { ResetGenerator(std::forward<Rest&&>(tail)...); - if (TryGeneratedPaths(std::forward<Fn&&>(checker), path, + if (TryGeneratedPaths(std::forward<CallbackFn&&>(filesCollector), path, std::forward<Rest&&>(tail)...)) { return true; } |