diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H index 826bb95741..0e13b7c9a1 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 005979df3f..e2655da433 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::iterator::operator!= template -inline T& Foam::HashTable::iterator::operator*() +inline T& +Foam::HashTable::iterator::operator*() { return elmtPtr_->obj_; } template -inline T& Foam::HashTable::iterator::operator()() +inline T& +Foam::HashTable::iterator::operator()() { - return operator*(); + return elmtPtr_->obj_; +} + + +template +inline const T& +Foam::HashTable::iterator::operator*() const +{ + return elmtPtr_->obj_; +} + + +template +inline const T& +Foam::HashTable::iterator::operator()() const +{ + return elmtPtr_->obj_; } @@ -410,16 +428,18 @@ inline bool Foam::HashTable::const_iterator::operator!= template -inline const T& Foam::HashTable::const_iterator::operator*() +inline const T& +Foam::HashTable::const_iterator::operator*() const { return elmtPtr_->obj_; } #ifndef __CINT__ template -inline const T& Foam::HashTable::const_iterator::operator()() +inline const T& +Foam::HashTable::const_iterator::operator()() const { - return operator*(); + return elmtPtr_->obj_; } #endif