diff options
author | Brad King <brad.king@kitware.com> | 2015-01-15 14:54:04 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-01-15 14:54:04 (GMT) |
commit | 4ecc392b42e999e3e103eac0c0e28fa63c39167c (patch) | |
tree | afc707f7434f8fbf617c2960e7e8f8d90fffc866 /Source/cmGeneratorExpressionEvaluator.cxx | |
parent | 6418eef222304db9a884a3cf101f86c2eabfb503 (diff) | |
parent | 65b81da458614c6a4652ea2e4fc933893c671281 (diff) | |
download | CMake-4ecc392b42e999e3e103eac0c0e28fa63c39167c.zip CMake-4ecc392b42e999e3e103eac0c0e28fa63c39167c.tar.gz CMake-4ecc392b42e999e3e103eac0c0e28fa63c39167c.tar.bz2 |
Merge topic 'delete-algorithm'
65b81da4 cmVariableWatch: Use the cmDeleteAll algorithm with for_each.
30d2de9a cmGeneratorExpressionEvaluator: Replace own algorithm with cmDeleteAll.
4a6e795b Use the cmDeleteAll algorithm instead of trivial raw loops.
abb4a678 Add a generic algorithm for deleting items in a container.
Diffstat (limited to 'Source/cmGeneratorExpressionEvaluator.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionEvaluator.cxx | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 6b2d461..3b1e9c2 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -2052,30 +2052,9 @@ std::string GeneratorExpressionContent::EvaluateParameters( } //---------------------------------------------------------------------------- -static void deleteAll(const std::vector<cmGeneratorExpressionEvaluator*> &c) -{ - std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it - = c.begin(); - const std::vector<cmGeneratorExpressionEvaluator*>::const_iterator end - = c.end(); - for ( ; it != end; ++it) - { - delete *it; - } -} - -//---------------------------------------------------------------------------- GeneratorExpressionContent::~GeneratorExpressionContent() { - deleteAll(this->IdentifierChildren); - - typedef std::vector<cmGeneratorExpressionEvaluator*> EvaluatorVector; - std::vector<EvaluatorVector>::const_iterator pit = - this->ParamChildren.begin(); - const std::vector<EvaluatorVector>::const_iterator pend = - this->ParamChildren.end(); - for ( ; pit != pend; ++pit) - { - deleteAll(*pit); - } + cmDeleteAll(this->IdentifierChildren); + std::for_each(this->ParamChildren.begin(), this->ParamChildren.end(), + cmDeleteAll<std::vector<cmGeneratorExpressionEvaluator*> >); } |