allocate_at_least( std::size_t n ); (C++23 起) 调用::operator new(可能带有额外的 std::align_val_t 实参)分配 count * sizeof(T) 字节的未初始化存储,其中 count 是未指定的不小于 n 的整数值,但未指定何时及如何调用此函数。 然后,此函数在该存储中创建一个 T[count] 数组并开始其生存期,...
is_always_equal如果存在就是Alloc::is_always_equal,否则是std::is_empty<Alloc>::type 成员别名模版 类型定义 rebind_alloc<T>如果存在就是Alloc::rebind<T>::other,否则在此Alloc是Alloc<U, Args>时就是Alloc<T, Args> rebind_traits<T>std::allocator_traits<rebind_alloc<T>> ...
std::allocator Defined in header<memory> template<classT> structallocator; (1) template<> structallocator<void>; (2)(deprecated in C++17) (removed in C++20) Thestd::allocatorclass template is the defaultAllocatorused by all standard library containers if no user-specified allocator is provided...
(none) Example This section is incomplete Reason: no example See also allocate [static] allocates uninitialized storage using the allocator (public static member function) deallocate deallocates storage (public member function ofstd::allocator<T>)...
std::vector Defined in header<vector> template< classT, classAllocator=std::allocator<T> >classvector; (1) namespace { template<classT> usingvector=std::vector<T,std::pmr::polymorphic_allocator<T>>; } (2) (since C++17) 1)std::vectoris a sequence container that encapsulates dynamic siz...
size_type size()const; (noexcept since C++11) Returns the number of elements in the container, i.e.std::distance(begin(), end()). Return value The number of elements in the container. Complexity Constant. Example The following code usessizeto display the number of elements in astd::dequ...
const_pointerAllocator::const_pointer(bis C + +11) std::allocator_traits<Allocator>::const_pointer(seit C++11)[edit] iteratorBidirectionalIterator[edit] const_iterator Constant bidirektionalen Iterator Original: Constant bidirectional iterator
class Allocator = std::allocator<T> > class list; std::list est un conteneur qui permet l'insertion et la suppression rapide d'éléments depuis n'importe quel endroit du conteneur. L'accès rapide à une position aléatoire n'est pas supporté. std::list est implémenté comme une liste...
tuple(std::allocator_arg_t,constAlloc&a, consttuple<UTypes...>&other); (13)(desde C++11) (constexpr desde C++20) (condicionalmente explícito) template<classAlloc,class...UTypes> tuple(std::allocator_arg_t,constAlloc&a, tuple<UTypes...>&&other); ...
constAllocator&alloc=Allocator()); (2) basic_string(constbasic_string&other, size_type pos, size_type count=std::basic_string::npos, constAllocator&alloc=Allocator()); (3) basic_string(constCharT*s, size_type count, constAllocator&alloc=Allocator()); ...