Add templated find overload for compatible keys.

[SVN r58405]
This commit is contained in:
Daniel James
2009-12-15 22:53:33 +00:00
parent 493f905598
commit b99382b551
7 changed files with 287 additions and 0 deletions
+40
View File
@@ -422,6 +422,26 @@ namespace boost
return const_iterator(table_.find(k));
}
template <class CompatibleKey, class CompatibleHash,
class CompatiblePredicate>
iterator find(
CompatibleKey const& k,
CompatibleHash const& hash,
CompatiblePredicate const& eq)
{
return iterator(table_.find(k, hash, eq));
}
template <class CompatibleKey, class CompatibleHash,
class CompatiblePredicate>
const_iterator find(
CompatibleKey const& k,
CompatibleHash const& hash,
CompatiblePredicate const& eq) const
{
return iterator(table_.find(k, hash, eq));
}
size_type count(const key_type& k) const
{
return table_.count(k);
@@ -925,6 +945,26 @@ namespace boost
return const_iterator(table_.find(k));
}
template <class CompatibleKey, class CompatibleHash,
class CompatiblePredicate>
iterator find(
CompatibleKey const& k,
CompatibleHash const& hash,
CompatiblePredicate const& eq)
{
return iterator(table_.find(k, hash, eq));
}
template <class CompatibleKey, class CompatibleHash,
class CompatiblePredicate>
const_iterator find(
CompatibleKey const& k,
CompatibleHash const& hash,
CompatiblePredicate const& eq) const
{
return iterator(table_.find(k, hash, eq));
}
size_type count(const key_type& k) const
{
return table_.count(k);