Skip to content

Potential crash: std::vector::resize and std::vector::reserve #151

Open
@Fr3ya

Description

This issue lies in the test/kvec_test.cc line 57

The function of resize() and reserve() is a little similar, but reserve() only gives to enough room so that future call that leads to increase of the size (e.g. calling push_back()) will be more efficient. So maybe line57 as follows is better:
for (j = 0; j < N; ++j) array.push_back(j);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions