cplusplus-ified vector implementation