1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00

constify weakcache overloaded operators

This commit is contained in:
Bret Curtis 2022-02-25 18:09:12 +01:00
parent 1927b1c6d9
commit 6601274992

View File

@ -22,8 +22,8 @@ namespace Misc
public:
iterator(WeakCache* cache, typename Map::iterator current, typename Map::iterator end);
iterator& operator++();
bool operator==(const iterator& other);
bool operator!=(const iterator& other);
bool operator==(const iterator& other) const;
bool operator!=(const iterator& other) const;
StrongPtr operator*();
private:
WeakCache* mCache;
@ -74,13 +74,13 @@ namespace Misc
}
template <typename Key, typename T>
bool WeakCache<Key, T>::iterator::operator==(const iterator& other)
bool WeakCache<Key, T>::iterator::operator==(const iterator& other) const
{
return mCurrent == other.mCurrent;
}
template <typename Key, typename T>
bool WeakCache<Key, T>::iterator::operator!=(const iterator& other)
bool WeakCache<Key, T>::iterator::operator!=(const iterator& other) const
{
return !(*this == other);
}