Namespaces
Variants
Views
Actions

std::inplace_vector<T,N>::shrink_to_fit

From cppreference.com
< cpp‎ | container‎ | inplace vector
Revision as of 07:08, 15 August 2024 by Space Mission (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 
 
 
 
static constexpr void shrink_to_fit() noexcept;
(since C++26)

Does nothing. Theoretically, this function performs a non-binding request to decrease the capacity to size() elements. However, such a request is ignored because each std::inplace_vector<T, N> is a fixed-capacity container.

Contents

Parameters

(none)

Complexity

Constant.

Notes

This function exists for compatibility with vector-like interfaces.

See also

returns the number of elements
(public member function) [edit]
changes the number of elements stored
(public member function) [edit]
[static]
returns the number of elements that can be held in currently allocated storage
(public static member function) [edit]
reduces memory usage by freeing unused memory
(public member function of std::vector<T,Allocator>) [edit]
reduces memory usage by freeing unused memory
(public member function of std::deque<T,Allocator>) [edit]