cmVariableWatch: Use the cmDeleteAll algorithm with for_each.

This commit is contained in:
Stephen Kelly 2015-01-04 16:33:15 +01:00
parent 30d2de9aa8
commit 65b81da458
1 changed files with 8 additions and 13 deletions

View File

@ -34,21 +34,16 @@ cmVariableWatch::cmVariableWatch()
{
}
template<typename C>
void deleteAllSecond(typename C::value_type it)
{
cmDeleteAll(it.second);
}
cmVariableWatch::~cmVariableWatch()
{
cmVariableWatch::StringToVectorOfPairs::iterator svp_it;
for ( svp_it = this->WatchMap.begin();
svp_it != this->WatchMap.end(); ++svp_it )
{
cmVariableWatch::VectorOfPairs::iterator p_it;
for ( p_it = svp_it->second.begin();
p_it != svp_it->second.end(); ++p_it )
{
delete *p_it;
}
}
std::for_each(this->WatchMap.begin(), this->WatchMap.end(),
deleteAllSecond<cmVariableWatch::StringToVectorOfPairs>);
}
bool cmVariableWatch::AddWatch(const std::string& variable,