المتغيرات
فضاءات التسمية
أفعال

std::{{{1}}}::reserve

من cppreference.com
void reserve( size_type new_cap );
قالب:mark since none

Increase the capacity of the container to a value that's greater or equal to ‎new_cap‎. If ‎new_cap‎ is greater than the current capacity()‎, new storage is allocated, otherwise the method does nothing.

Information on iterator invalidation is copied from here

محتويات

[تعديل] Parameters

new_cap - new capacity of the container


[تعديل] Return value

(none)

[تعديل] Exceptions

std::length_error‎ if new_cap > max_size().

[تعديل] Complexity

At most linear in the size()‎ of the container.

[تعديل] Notes

reserve()‎ cannot be used to reduce the capacity of the container, to that end shrink_to_fit()‎ is provided.

[تعديل] Example

[تعديل] See also

قالب:dsc mem funقالب:dsc mem funقالب:dsc mem funقالب:dsc mem fun