--- parser3/src/include/pa_array.h 2003/03/19 13:16:56 1.57.2.27.2.2 +++ parser3/src/include/pa_array.h 2003/03/20 13:09:53 1.57.2.27.2.4 @@ -8,7 +8,7 @@ #ifndef PA_ARRAY_H #define PA_ARRAY_H -static const char* IDENT_ARRAY_H="$Date: 2003/03/19 13:16:56 $"; +static const char* IDENT_ARRAY_H="$Date: 2003/03/20 13:09:53 $"; // includes @@ -26,9 +26,6 @@ template class Array: public protected: - // default expand delta size - int fdelta; - /// elements[growing size] here T *felements; @@ -47,21 +44,13 @@ public: { felements=static_cast(malloc(fallocated*sizeof(T))); } - override ~Array() { - // see comment in ctor - T *last=felements+fused; - for(T *current=felements; current~T(); // manually invoking destructors - - free(felements); - } /// how many items are in Array int count() const { return fused; } /// append to array Array& operator += (T src) { if(is_full()) - expand(fdelta); + expand(2); felements[fused++]=src; @@ -72,7 +61,7 @@ public: Array& append(const Array& src, int offset=0, int limit=0) { if(offset<0) { throw Exception(0, - Exception::undefined_source, + 0, "Array::append(offset=%d) out <0", offset); //return Nothing; // never } @@ -103,7 +92,7 @@ public: T& get(int index) const { if(!(index>=0 && index=0 && index