diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H index 826bb95741ba387d2cc86572119d1b3780020306..0e13b7c9a1d82016ff51b5915f09db97b6a42a64 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H @@ -330,6 +330,9 @@ public: inline T& operator*(); inline T& operator()(); + inline const T& operator*() const; + inline const T& operator()() const; + inline iterator& operator++(); inline iterator operator++(int); @@ -389,8 +392,8 @@ public: inline bool operator==(const iterator&) const; inline bool operator!=(const iterator&) const; - inline const T& operator*(); - inline const T& operator()(); + inline const T& operator*() const; + inline const T& operator()() const; inline const_iterator& operator++(); inline const_iterator operator++(int); diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H index 005979df3f166a27ae3a91250cde1f81f5f55321..e2655da4334ea4878513b757d56d1133156b35b5 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H @@ -220,16 +220,34 @@ inline bool Foam::HashTable<T, Key, Hash>::iterator::operator!= template<class T, class Key, class Hash> -inline T& Foam::HashTable<T, Key, Hash>::iterator::operator*() +inline T& +Foam::HashTable<T, Key, Hash>::iterator::operator*() { return elmtPtr_->obj_; } template<class T, class Key, class Hash> -inline T& Foam::HashTable<T, Key, Hash>::iterator::operator()() +inline T& +Foam::HashTable<T, Key, Hash>::iterator::operator()() { - return operator*(); + return elmtPtr_->obj_; +} + + +template<class T, class Key, class Hash> +inline const T& +Foam::HashTable<T, Key, Hash>::iterator::operator*() const +{ + return elmtPtr_->obj_; +} + + +template<class T, class Key, class Hash> +inline const T& +Foam::HashTable<T, Key, Hash>::iterator::operator()() const +{ + return elmtPtr_->obj_; } @@ -410,16 +428,18 @@ inline bool Foam::HashTable<T, Key, Hash>::const_iterator::operator!= template<class T, class Key, class Hash> -inline const T& Foam::HashTable<T, Key, Hash>::const_iterator::operator*() +inline const T& +Foam::HashTable<T, Key, Hash>::const_iterator::operator*() const { return elmtPtr_->obj_; } #ifndef __CINT__ template<class T, class Key, class Hash> -inline const T& Foam::HashTable<T, Key, Hash>::const_iterator::operator()() +inline const T& +Foam::HashTable<T, Key, Hash>::const_iterator::operator()() const { - return operator*(); + return elmtPtr_->obj_; } #endif