--- parser3/src/include/pa_array.h 2003/07/24 11:31:21 1.59 +++ parser3/src/include/pa_array.h 2003/11/20 16:34:24 1.62 @@ -8,7 +8,7 @@ #ifndef PA_ARRAY_H #define PA_ARRAY_H -static const char* IDENT_ARRAY_Y="$Date: 2003/07/24 11:31:21 $"; +static const char * const IDENT_ARRAY_Y="$Date: 2003/11/20 16:34:24 $"; // includes @@ -164,6 +164,13 @@ public: callback(*current, info); } + /// iterate over all elements + template void for_each_ref(void (*callback)(T&, I), I info) { + T *last=felements+fused; + for(T *current=felements; current T first_that(bool (*callback)(T, I), I info) const { T *last=felements+fused; @@ -226,39 +233,4 @@ public: } }; -/* -/** Nonconst array iterator, usage: - @code - // Array a; - for(Array_iterator i(a); i.has_next(); ) { - T& element=i.next(); - ... - } - @endcode -* / -template class Array_modifing_iterator { - - Array& farray; - T *fcurrent; - T *flast; - -public: - - Array_modifing_iterator(Array& aarray): farray(aarray) { - fcurrent=farray.felements; - flast=farray.felements+farray.count(); - } - - /// there are still elements - bool has_next() { - return fcurrent