--- parser3/src/include/pa_array.h 2005/08/09 08:14:49 1.65 +++ parser3/src/include/pa_array.h 2006/11/03 18:13:54 1.70 @@ -8,7 +8,7 @@ #ifndef PA_ARRAY_H #define PA_ARRAY_H -static const char * const IDENT_ARRAY_Y="$Date: 2005/08/09 08:14:49 $"; +static const char * const IDENT_ARRAY_Y="$Date: 2006/11/03 18:13:54 $"; // includes @@ -56,12 +56,11 @@ public: bool adjust(size_t count) { if(!count || !limit) return false; - size_t row=offset; - if(row>=count) + if(offset>=count) return false; // max(limit) size_t m=reverse? - offset + offset+1 :count-offset; if(!m) return false; @@ -89,7 +88,7 @@ public: /// append to array Array& operator += (T src) { if(is_full()) - expand(2); + expand(+2); felements[fused++]=src; @@ -165,6 +164,14 @@ public: } /// iterate over all elements + template void for_each(bool (*callback)(T, I), I info) const { + T *last=felements+fused; + for(T *current=felements; current void for_each_ref(void (*callback)(T&, I), I info) { T *last=felements+fused; for(T *current=felements; current