#include "stdafx.h" #include "kryString.h" #include "kryArray.h" template kryArray::kryArray() : m_count(0), m_capacity(10) { this->m_array = new T[m_capacity]; } template kryArray::kryArray(int capacity) : m_count(0), m_capacity(capacity) { this->m_array = new T[m_capacity]; } template kryArray::~kryArray() { delete [] this->m_array; } template void kryArray::Resize(int new_size) { T *new_array = new T[new_size]; for(int i = 0; i < this->m_count; i++) new_array[i] = this->m_array[i]; delete [] this->m_array; this->m_array = new_array; } template void kryArray::Add(T obj) { if(this->m_capacity == this->m_count) this->Resize(this->m_capacity * 2); this->m_array[this->m_count] = obj; this->m_count++; } template int kryArray::GetCount() { return this->m_count; } template RT kryArray::operator [](int index) { return this->m_array[index]; } template class kryArray; template class kryArray;