mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user