Ad
  • Default User Avatar

    While this works, push_back in a loop results in unnecessary allocations as the vector expands, you should reserve the result vector first.