cmAlgorithms: Add missing const to functors.

This commit is contained in:
Stephen Kelly 2015-02-17 19:32:52 +01:00
parent 7490632258
commit 10e53e2308

View File

@ -99,7 +99,7 @@ template<typename Container,
bool valueTypeIsPair = cmIsPair<typename Container::value_type>::value> bool valueTypeIsPair = cmIsPair<typename Container::value_type>::value>
struct DefaultDeleter struct DefaultDeleter
{ {
void operator()(typename Container::value_type value) { void operator()(typename Container::value_type value) const {
delete value; delete value;
} }
}; };
@ -107,7 +107,7 @@ struct DefaultDeleter
template<typename Container> template<typename Container>
struct DefaultDeleter<Container, /* valueTypeIsPair = */ true> struct DefaultDeleter<Container, /* valueTypeIsPair = */ true>
{ {
void operator()(typename Container::value_type value) { void operator()(typename Container::value_type value) const {
delete value.second; delete value.second;
} }
}; };
@ -163,7 +163,7 @@ struct BinarySearcher
{ {
} }
bool operator()(argument_type const& item) bool operator()(argument_type const& item) const
{ {
return std::binary_search(m_range.begin(), m_range.end(), item); return std::binary_search(m_range.begin(), m_range.end(), item);
} }