void reserve(unsigned int size) { T* old = _data; _data = NREX_NEW_ARRAY(T, size); _reserved = size; for (unsigned int i = 0; i < _size; ++i) { _data[i] = old[i]; } NREX_DELETE_ARRAY(old); }
nrex_array() : _data(NREX_NEW_ARRAY(T, 2)) , _reserved(2) , _size(0) { }
nrex_array(unsigned int reserved) : _data(NREX_NEW_ARRAY(T, reserved ? reserved : 1)) , _reserved(reserved ? reserved : 1) , _size(0) { }