mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
added HashSet::operator[]() const
- can use the same syntax for boolList, PackedBoolList and labelHashSet
if (myHashedSet[x]) ...
if (myBoolList[x]) ...
if (myPackedList[x]) ...
This commit is contained in:
@ -51,6 +51,13 @@ Foam::HashSet<Key, Hash>::HashSet(const HashTable<AnyType, Key, Hash>& ht)
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
template<class Key, class Hash>
|
||||
inline bool Foam::HashSet<Key, Hash>::operator[](const Key& key) const
|
||||
{
|
||||
return found(key);
|
||||
}
|
||||
|
||||
|
||||
template<class Key, class Hash>
|
||||
bool Foam::HashSet<Key, Hash>::operator==(const HashSet<Key, Hash>& rhs) const
|
||||
{
|
||||
|
||||
@ -133,9 +133,11 @@ public:
|
||||
return HashTable<nil, Key, Hash>::insert(key, nil());
|
||||
}
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Return true if the entry exists, same as found()
|
||||
inline bool operator[](const Key&) const;
|
||||
|
||||
//- Equality. Two hashtables are equal when their contents are equal.
|
||||
// Independent of table size or order.
|
||||
bool operator==(const HashSet<Key, Hash>&) const;
|
||||
|
||||
Reference in New Issue
Block a user