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
;
|
(since C++26) | |
Does nothing.
Nominally, this function is a non-binding request to decrease capacity so that the internal storage contains only size() elements. However, such a request is always ignored by the fixed-capacity container std:: inplace_vector < T, N > .
Contents |
Parameters
(none)
Return value
(none)
Complexity
Constant.
Notes
This function exists for compatibility with vector-like interfaces.
See also
|
returns the number of elements
(public member function) |
|
|
changes the number of elements stored
(public member function) |
|
|
[static]
|
returns the number of elements that can be held in currently allocated storage
(public static member function) |
|
(
DR*
)
|
reduces memory usage by freeing unused memory
(public member function of
std::vector<T,Allocator>
)
|
|
(
DR*
)
|
reduces memory usage by freeing unused memory
(public member function of
std::deque<T,Allocator>
)
|