vector implementation in c++