Replication of C++ STL Vector Class