summaryrefslogtreecommitdiff
path: root/Source/cmAlgorithms.h
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-02-20 21:52:36 +0100
committerStephen Kelly <steveire@gmail.com>2015-02-23 20:19:35 +0100
commit47a3e22ea5aee971df1e04a6447bb916af81aa2c (patch)
tree740feb33240cfe35d4d6aea73d51a13720cf36b2 /Source/cmAlgorithms.h
parentcb75eec0b45eda230996580043e00e38d35a1e5b (diff)
downloadcmake-47a3e22ea5aee971df1e04a6447bb916af81aa2c.tar.gz
cmAlgorithms: Rename template type in cmDeleteAll algorithm.
It may be any range, not only a container.
Diffstat (limited to 'Source/cmAlgorithms.h')
-rw-r--r--Source/cmAlgorithms.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 56e7f17233..4b03736258 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -105,19 +105,19 @@ struct cmIsPair<std::pair<K, V> >
enum { value = true };
};
-template<typename Container,
- bool valueTypeIsPair = cmIsPair<typename Container::value_type>::value>
+template<typename Range,
+ bool valueTypeIsPair = cmIsPair<typename Range::value_type>::value>
struct DefaultDeleter
{
- void operator()(typename Container::value_type value) const {
+ void operator()(typename Range::value_type value) const {
delete value;
}
};
-template<typename Container>
-struct DefaultDeleter<Container, /* valueTypeIsPair = */ true>
+template<typename Range>
+struct DefaultDeleter<Range, /* valueTypeIsPair = */ true>
{
- void operator()(typename Container::value_type value) const {
+ void operator()(typename Range::value_type value) const {
delete value.second;
}
};
@@ -187,11 +187,11 @@ cmRange(Range const& range)
range.begin(), range.end());
}
-template<typename Container>
-void cmDeleteAll(Container const& c)
+template<typename Range>
+void cmDeleteAll(Range const& r)
{
- std::for_each(c.begin(), c.end(),
- ContainerAlgorithms::DefaultDeleter<Container>());
+ std::for_each(r.begin(), r.end(),
+ ContainerAlgorithms::DefaultDeleter<Range>());
}
template<typename Range>