On 2012-12-13 23:08 , Lawrence Crowl wrote:
+ class iterator + { + public: + inline iterator (); + inline iterator (value_type **, value_type **); + inline value_type &operator * (); + void slide (); + inline iterator &operator ++ (); + inline bool operator != (const iterator &) const; + private: + value_type **slot_; + value_type **limit_; + }; +
This reminds me... We (OK, *I*) should do the same in vec<>.
+/* Iterate through the elements of hash_table HTAB, + using hash_table <....>::iterator ITER, + storing each element in RESULT, which is of type TYPE. + + This macro has this form for compatibility with the + FOR_EACH_HTAB_ELEMENT currently defined in tree-flow.h. */ + +#define FOR_EACH_HASH_TABLE_ELEMENT(HTAB, RESULT, TYPE, ITER) \ + for ((ITER) = (HTAB).begin (); \ + (ITER) != (HTAB).end () ? (RESULT = &*(ITER) , true) : false; \ + ++(ITER)) +
I wonder if we shouldn't just get rid of this style of iteration. I never quite liked it. I guess it doesn't hurt, though.
The patch is OK. Thanks. Diego.