My version of C++ vector from book Programming principles and practice using cpp