std::inplace_vector<T,N>:: shrink_to_fit
From cppreference.net
<
cpp
|
container
|
inplace vector
C++
Containers library
|
(C++17)
|
||||
| Sequence | ||||
|
(C++11)
|
||||
|
(C++26)
|
||||
|
(C++26)
|
||||
|
(C++11)
|
||||
| Associative | ||||
| Unordered associative | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Adaptors | ||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
| Views | ||||
|
(C++20)
|
||||
|
(C++23)
|
||||
| Tables | ||||
| Iterator invalidation | ||||
| Member function table | ||||
| Non-member function table |
std::inplace_vector
| Member types | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Non-member functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
static
constexpr
void
shrink_to_fit
(
)
noexcept
;
|
(自 C++26 起) | |
不执行任何操作。
名义上,该函数是一个非强制性请求,旨在缩减容量使得内部存储仅保留 size() 个元素。然而,固定容量容器 std:: inplace_vector < T, N > 始终会忽略此类请求。
目录 |
参数
(无)
返回值
(无)
复杂度
常量。
注释
此函数的存在是为了与类似向量的接口保持兼容。
参见
|
返回元素数量
(公开成员函数) |
|
|
修改存储的元素数量
(公开成员函数) |
|
|
[static]
|
返回当前分配存储空间可容纳的元素数量
(公开静态成员函数) |
|
(
DR*
)
|
通过释放未使用的内存来减少内存使用
(
std::vector<T,Allocator>
的公开成员函数)
|
|
(
DR*
)
|
通过释放未使用的内存来减少内存使用
(
std::deque<T,Allocator>
的公开成员函数)
|