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_traits::construct

Defined in header <memory> template< class T, class... Args > static void construct( Alloc& a, T* p, Args&&... args ); (since C++11) If possible, constructs an object of type T in allocated uninitialized storage pointed to by p, by calling. a.construct(p, std::forward<Args>(args)...). If the above is not possible (e.g. a does not have the member function construct(),), then calls placement-new as. ::new (static_cast<void*>(p)) T(std::forward<

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_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::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::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::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

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::address

pointer address( reference x ) const; const_pointer address( const_reference x ) const; Returns the actual address of x even in presence of overloaded operator&. Parameters x - the object to acquire address of Return value The actual address of x. Exceptions (none) (until C++11) noexcept specification: noexcept (since C++11)

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