| 41 | } |
| 42 | } |
| 43 | void add(const T& t) { |
| 44 | if (this->_size==this->_reserved) { |
| 45 | if (this->_reserved) |
| 46 | this->_reserved*=2; |
| 47 | else |
| 48 | this->_reserved = 8; |
| 49 | T* tmp = new T[this->_reserved]; |
| 50 | if (this->_data) { |
| 51 | for (U32 i=0;i<this->_size;i++) { |
| 52 | tmp[i] = this->_data[i]; |
| 53 | } |
| 54 | delete[] this->_data; |
| 55 | } |
| 56 | this->_data = tmp; |
| 57 | } |
| 58 | this->_data[this->_size] = t; |
| 59 | this->_size++; |
| 60 | } |
| 61 | void removeAt(int idx) { |
| 62 | #ifdef _DEBUG |
| 63 | if (idx>=this->size()) |