vector::clear()、vector::shrink_to_fit() の連続実行で十分なのでは?