analog the STL vector part function