std::allocator_traits::allocate

Defined in header <memory> static pointer allocate( Alloc& a, size_type n ); (1) (since C++11) static pointer allocate( Alloc& a, size_type n, const_void_pointer hint ); (2) (since C++11) Uses the allocator a to allocate n*sizeof(Alloc::value_type) bytes of uninitialized storage. 1) Calls a.allocate(n) 2) Additionally passes memory locality hint hint. Calls a.allocate(n, hint) if possible. If not possible (e.g. a has no two-argument member function allocate

std::allocator_traits

Defined in header <memory> template< class Alloc > struct allocator_traits; (since C++11) The allocator_traits class template provides the standardized way to access various properties of allocators. The standard containers and other standard library components access allocators through this template, which makes it possible to use any class type as an allocator, as long as the user-provided specialization of allocator_traits implements all required functionality. The

std::allocator_arg_t

Defined in header <memory> struct allocator_arg_t {}; (since C++11) std::allocator_arg_t is an empty class type used to disambiguate the overloads of constructors and member functions of allocator-aware objects, including std::tuple, std::function, std::promise, and std::packaged_task. See also allocator_arg (C++11) an object of type std::allocator_arg_t used to select allocator-aware constructors (constant) uses_allocator (C++11) checks if the specified typ

std::allocator_arg

Defined in header <memory> constexpr std::allocator_arg_t allocator_arg = std::allocator_arg_t(); (since C++11) std::allocator_arg is a constant of type std::allocator_arg_t used to disambiguate, at call site, the overloads of the constructors and member functions of allocator-aware objects, such as std::tuple, std::function, std::promise, and std::packaged_task. See also allocator_arg_t (C++11) tag type used to select allocator-aware constructor overloads (class)

std::allocator::max_size

Defined in header <memory> size_type max_size() const; Returns the maximum theoretically possible value of n, for which the call allocate(n, 0) could succeed. In most implementations, this returns std::numeric_limits<size_type>::max(). Parameters (none). Return value The maximum supported allocation size. Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11) See also max_size [static] returns the maximum object size su

std::allocator::destroy

Defined in header <memory> void destroy( pointer p ); (until C++11) template< class U > void destroy( U* p ); (since C++11) Calls the destructor of the object pointed to by p. 1) Calls ((T*)p)->~T() 2) Calls p->~U() Parameters p - pointer to the object that is going to be destroyed Return value (none). See also destroy [static] destructs an object stored in the allocated storage (function template)

std::allocator::deallocate

Defined in header <memory> void deallocate( pointer p, size_type n ); Deallocates the storage referenced by the pointer p, which must be a pointer obtained by an earlier call to allocate(). The argument n must be equal to the first argument of the call to allocate() that originally produced p. Calls ::operator delete(void*), but it is unspecified when and how it is called. Parameters p - pointer obtained from allocate() n - number of objects earlier passed to

std::allocator::construct

Defined in header <memory> void construct( pointer p, const_reference val ); (1) (until C++11) template< class U, class... Args > void construct( U* p, Args&&... args ); (2) (since C++11) Constructs an object of type T in allocated uninitialized storage pointed to by p, using placement-new. 1) Calls new((void *)p) T(val). 2) Calls ::new((void *)p) U(std::forward<Args>(args)...). Parameters p - pointer to allocated uninitialized storage va

std::allocator::allocator

allocator(); (1) allocator( const allocator& other ); (2) template< class U > allocator( const allocator<U>& other ); (3) Constructs the default allocator. Since the default allocator is stateless, the constructors have no visible effect. Parameters other - another allocator to construct with Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11)

std::allocator::allocate

pointer allocate( size_type n, std::allocator<void>::const_pointer hint = 0 ); Allocates n * sizeof(T) bytes of uninitialized storage by calling ::operator new(std::size_t), but it is unspecified when and how this function is called. The pointer hint may be used to provide locality of reference: the allocator, if supported by the implementation, will attempt to allocate the new memory block as close as possible to hint. Parameters n - the number of objects to allocate stor