diff options
Diffstat (limited to 'src/context')
-rw-r--r-- | src/context/cdhashmap.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/context/cdhashmap.h b/src/context/cdhashmap.h index 0a1f3387c..05d68ead5 100644 --- a/src/context/cdhashmap.h +++ b/src/context/cdhashmap.h @@ -82,6 +82,7 @@ #ifndef CVC4__CONTEXT__CDHASHMAP_H #define CVC4__CONTEXT__CDHASHMAP_H +#include <cstddef> #include <functional> #include <iterator> #include <unordered_map> @@ -394,7 +395,12 @@ public: class iterator { const Element* d_it; - public: + public: + using iterator_category = std::input_iterator_tag; + using value_type = typename CDOhash_map<Key, Data, HashFcn>::value_type; + using difference_type = ptrdiff_t; + using pointer = typename CDOhash_map<Key, Data, HashFcn>::value_type*; + using reference = typename CDOhash_map<Key, Data, HashFcn>::value_type&; iterator(const Element* p) : d_it(p) {} iterator(const iterator& i) : d_it(i.d_it) {} @@ -403,18 +409,15 @@ public: iterator() : d_it(nullptr) {} // (Dis)equality - bool operator==(const iterator& i) const { - return d_it == i.d_it; - } - bool operator!=(const iterator& i) const { - return d_it != i.d_it; - } + bool operator==(const iterator& i) const { return d_it == i.d_it; } + bool operator!=(const iterator& i) const { return d_it != i.d_it; } // Dereference operators. const value_type& operator*() const { return d_it->getValue(); } // Prefix increment - iterator& operator++() { + iterator& operator++() + { d_it = d_it->next(); return *this; } |