diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2019-12-05 15:09:27 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2019-12-05 16:20:56 (GMT) |
commit | d74416a9cde9876eff7148161cfdc3500125bb49 (patch) | |
tree | 06f0e215b6bde70f6fd31cdeba7860bba8e6938d /Source/cmGeneratorExpressionParser.h | |
parent | 8ee4f372aad33eba556c2ec116498ea949dcf03c (diff) | |
download | CMake-d74416a9cde9876eff7148161cfdc3500125bb49.zip CMake-d74416a9cde9876eff7148161cfdc3500125bb49.tar.gz CMake-d74416a9cde9876eff7148161cfdc3500125bb49.tar.bz2 |
cmGeneratorExpressionEvaluator: Modernize memory management
Diffstat (limited to 'Source/cmGeneratorExpressionParser.h')
-rw-r--r-- | Source/cmGeneratorExpressionParser.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmGeneratorExpressionParser.h b/Source/cmGeneratorExpressionParser.h index e663496..1ba1654 100644 --- a/Source/cmGeneratorExpressionParser.h +++ b/Source/cmGeneratorExpressionParser.h @@ -5,6 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <memory> #include <vector> #include "cmGeneratorExpressionLexer.h" @@ -15,11 +16,14 @@ struct cmGeneratorExpressionParser { cmGeneratorExpressionParser(std::vector<cmGeneratorExpressionToken> tokens); - void Parse(std::vector<cmGeneratorExpressionEvaluator*>& result); + using cmGeneratorExpressionEvaluatorVector = + std::vector<std::unique_ptr<cmGeneratorExpressionEvaluator>>; + + void Parse(cmGeneratorExpressionEvaluatorVector& result); private: - void ParseContent(std::vector<cmGeneratorExpressionEvaluator*>&); - void ParseGeneratorExpression(std::vector<cmGeneratorExpressionEvaluator*>&); + void ParseContent(cmGeneratorExpressionEvaluatorVector&); + void ParseGeneratorExpression(cmGeneratorExpressionEvaluatorVector&); private: std::vector<cmGeneratorExpressionToken>::const_iterator it; |