Added a method to reset the memory buffer of the DynArray class.

The the allocated memory will not be touched so the capacity keeps its current level.
This commit is contained in:
Reinhard Klambauer 2013-11-22 14:01:58 +01:00
parent 370761b179
commit 4e74b13e7a
1 changed files with 4 additions and 0 deletions

View File

@ -216,6 +216,10 @@ public:
} }
} }
void Reset() {
_size = 0;
}
void Push( T t ) { void Push( T t ) {
EnsureCapacity( _size+1 ); EnsureCapacity( _size+1 );
_mem[_size++] = t; _mem[_size++] = t;