2 associter.hh -- part of flowerlib
4 (c) 1996 Han-Wen Nienhuys
12 /// an iterator for the #Assoc# class
13 template<class K, class V>
17 /// we don't want to be bothered by const correctness
18 Assoc_iter(const Assoc<K,V> &a) :
19 assoc_((Assoc<K,V> &)a)
24 while (j < assoc_.arr.size() && assoc_.arr[j].free)
29 return i < assoc_.arr.size();
32 assert(!ok() || !assoc_.arr[i].free);
34 void operator++(int) { i++; i = next(i); }
35 K key() { return assoc_.arr[i].key; }
36 V &val() { return assoc_.arr[i].val; }