Skip to content

[vector.capacity] vector::reserve is tutorial-like #7401

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
jwakely opened this issue Nov 20, 2024 · 2 comments
Open

[vector.capacity] vector::reserve is tutorial-like #7401

jwakely opened this issue Nov 20, 2024 · 2 comments

Comments

@jwakely
Copy link
Member

jwakely commented Nov 20, 2024

Effects: A directive that informs a vector of a planned change in size, so that it can manage the storage
allocation accordingly.

This is not a description of what the function does, it's a description of what the function is.

Maybe just strike it.

For hive Matt originally copied this text, but we're suggesting a different form using "If n <= capacity() there are no effects." and "Postconditions: capacity() >= n is true. But that would be a topic for an LWG issue. Striking the tutorial-like first sentence seems editorial.

@Eisenwave
Copy link
Contributor

The current effects in https://eel.is/c++draft/vector.capacity#4 seem clear enough to me without this first sentence. I would also strike it.

@jensmaurer
Copy link
Member

Sounds good. Pull request welcome.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants