#ifndef CVC4__CONTEXT__CDHASHMAP_H
#define CVC4__CONTEXT__CDHASHMAP_H
+#include <cstddef>
#include <functional>
#include <iterator>
#include <unordered_map>
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) {}
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;
}