HashTable::erase from list of keys or the keys from another HashTable

- the parameter HashTable can hold arbitrary data .. just the type of keys
  needs to match
This commit is contained in:
Mark Olesen
2009-01-11 20:01:53 +01:00
parent a53b47355a
commit c2ac216eaf
7 changed files with 88 additions and 52 deletions

View File

@ -32,19 +32,19 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Key, class Hash>
template<class T>
Foam::HashSet<Key, Hash>::HashSet(const HashTable<T, Key, Hash>& ht)
template<class AnyType>
Foam::HashSet<Key, Hash>::HashSet(const HashTable<AnyType, Key, Hash>& ht)
:
HashTable<nil, Key, Hash>(ht.size())
{
for
(
typename HashTable<T, Key, Hash>::const_iterator iter = ht.begin();
iter != ht.end();
++iter
typename HashTable<AnyType, Key, Hash>::const_iterator cit = ht.begin();
cit != ht.end();
++cit
)
{
insert(iter.key());
insert(cit.key());
}
}