102template <
class T>
inline
105 this->array =
new T[size];
110template <
class T>
inline
113 delete [] this->array;
116template <
class T>
inline void
119 int oldsize = this->size;
120 T *oldarray = this->array;
122 this->array =
new T[this->size];
123 for (
int i = 0; i < oldsize; i++) this->array[i] = oldarray[i];
127template <
class T>
inline void
130 if (this->num >= this->size) growArray();
131 this->array[this->num++] = elem;
135template <
class T>
inline void
138 while (this->size <= this->num+array.
count()) growArray();
139 for (
int i=0;i<array.
count();i++)
140 this->array[this->num++] = array[i];
143template <
class T>
inline void
146 int newsize=this->num+array.
count();
148 if (this->size<=newsize) {
149 T *oldarray=this->array;
150 this->array=
new T[newsize];
152 for (i=0;i<array.
count(); i++) this->array[i] = array[i];
153 for (i=0;i<this->num;i++) this->array[i+array.
count()] = oldarray[i];
157 for (i=0;i<this->num;i++) this->array[array.
count()+i]=this->array[i];
158 for (i=0;i<array.
count();i++) this->array[i] = array[i];
160 this->num+=array.
count();
163template <
class T>
inline void
169 for (
int i = n; i > idx; i--) {
170 this->array[i] = this->array[i-1];
172 this->array[idx] = elem;
176template <
class T>
inline void
179 while (index >= this->size) growArray();
180 if (this->num <= index) this->num = index+1;
181 this->array[index] = elem;
184template <
class T>
inline T
187 return this->array[index];
190template <
class T>
inline void
193 elem = this->array[index];
196template <
class T>
inline T
199 return this->array[this->num-1];
202template <
class T>
inline void
205 elem = this->array[this->num-1];
208template <
class T>
inline T &
211 while (index >= this->size) growArray();
212 if (this->num <= index) this->num = index + 1;
213 return this->array[index];
216template <
class T>
inline T
219 return this->array[index];
222template <
class T>
inline void
225 if (this->num <= 0 || index >= this->num)
return;
226 for (
int i = index; i < this->num-1; i++)
227 this->array[i] = this->array[i+1];
231template <
class T>
inline void
234 this->array[index] = this->array[--this->num];
237template <
class T>
inline void
241 for (
int i=0;i<this->num/2;i++) {
243 this->array[i]=this->array[this->num-1-i];
244 this->array[this->num-1-i]=tmp;
248template <
class T>
inline void
251 if (count < this->num)
255template <
class T>
inline int
261template <
class T>
inline int
267template <
class T>
inline T *
273template <
class T>
inline const T *
279template <
class T>
inline void
282 delete [] this->array;
283 this->array =
new T[initsize];
284 this->size = initsize;
288template <
class T>
inline void
291 delete [] this->array;
297template <
class T>
inline void
300 T *oldarray = this->array;
301 this->array =
new T[this->num];
302 for (
int i = 0; i < this->num; i++) this->array[i] = oldarray[i];
303 this->size = this->num;