summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmVariableWatch.cxx21
1 files changed, 8 insertions, 13 deletions
diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx
index cb6cb12..b8a6df2 100644
--- a/Source/cmVariableWatch.cxx
+++ b/Source/cmVariableWatch.cxx
@@ -34,21 +34,16 @@ cmVariableWatch::cmVariableWatch()
{
}
-cmVariableWatch::~cmVariableWatch()
+template<typename C>
+void deleteAllSecond(typename C::value_type it)
{
- cmVariableWatch::StringToVectorOfPairs::iterator svp_it;
-
- for ( svp_it = this->WatchMap.begin();
- svp_it != this->WatchMap.end(); ++svp_it )
- {
- cmVariableWatch::VectorOfPairs::iterator p_it;
+ cmDeleteAll(it.second);
+}
- for ( p_it = svp_it->second.begin();
- p_it != svp_it->second.end(); ++p_it )
- {
- delete *p_it;
- }
- }
+cmVariableWatch::~cmVariableWatch()
+{
+ std::for_each(this->WatchMap.begin(), this->WatchMap.end(),
+ deleteAllSecond<cmVariableWatch::StringToVectorOfPairs>);
}
bool cmVariableWatch::AddWatch(const std::string& variable,