Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
std::allocator_traits(3)      C++ Standard Libary     std::allocator_traits(3)

NAME
       std::allocator_traits - std::allocator_traits

Synopsis
	  Defined in header <memory>
	  template< class Alloc	>     (since C++11)
	  struct allocator_traits;

	  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  spe-
       cialization of
	  allocator_traits implements all required functionality.

	  The  default,	non-specialized, allocator_traits contains the follow-
       ing members:

Member types
	  Type					 Definition
	  allocator_type			 Alloc
	  value_type				 Alloc::value_type
	  pointer				  Alloc::pointer  if  present,
       otherwise
						 value_type*
						 Alloc::const_pointer	    if
       present,	otherwise
	  const_pointer
       std::pointer_traits<pointer>::rebind<const
						 value_type>
	  void_pointer				    Alloc::void_pointer	    if
       present,	otherwise
						 std::pointer_traits<pointer>::re-
       bind<void>
						 Alloc::const_void_pointer  if
       present,
	  const_void_pointer			 otherwise
						 std::pointer_traits<pointer>::re-
       bind<const
						 void>
	  difference_type			   Alloc::difference_type   if
       present,	otherwise
						 std::pointer_traits<pointer>::dif-
       ference_type
	  size_type				  Alloc::size_type if present,
       otherwise
						 std::make_unsigned<differ-
       ence_type>::type
	  propagate_on_container_copy_assignment      Alloc::propagate_on_con-
       tainer_copy_assignment
						 if	present,     otherwise
       std::false_type
	  propagate_on_container_move_assignment      Alloc::propagate_on_con-
       tainer_move_assignment
						 if	present,     otherwise
       std::false_type
	  propagate_on_container_swap		      Alloc::propagate_on_con-
       tainer_swap if
						 present,	     otherwise
       std::false_type
	  is_always_equal			   Alloc::is_always_equal   if
       present,	otherwise
						 std::is_empty<Alloc>::type

Member alias templates
	  Type		   Definition
	  rebind_alloc<T>   Alloc::rebind<T>::other  if	present, otherwise Al-
       loc<T, Args> if
			   this	Alloc is Alloc<U, Args>
	  rebind_traits<T> std::allocator_traits<rebind_alloc<T>>

Member functions
	  allocate				allocates uninitialized	 stor-
       age using the
	  [static]				allocator
						(public	 static	 member	 func-
       tion)
	  deallocate				deallocates storage using  the
       allocator
	  [static]				 (public  static  member func-
       tion)
	  construct				constructs an  object  in  the
       allocated storage
	  [static]				(function template)
	  destroy				 destructs an object stored in
       the allocated
	  [static]				storage
						(function template)
	  max_size				 returns  the  maximum	object
       size supported by
	  [static]				the allocator
						(public	 static	 member	 func-
       tion)
	  select_on_container_copy_construction	obtains	the allocator  to  use
       after copying a
	  [static]				standard container
						(public	 static	 member	 func-
       tion)

	 Defect	reports

	  The following	behavior-changing defect reports were applied retroac-
       tively to
	  previously published C++ standards.

	     DR	   Applied to	       Behavior	as published		  Cor-
       rect behavior
	  LWG 2108 C++11      there was	no way to show an  allocator	is_al-
       ways_equal provided
			      is stateless

See also
	  allocator		   the default allocator
				   (class template)
	  scoped_allocator_adaptor implements multi-level allocator for	multi-
       level containers
	  (C++11)		   (class template)
	  pointer_traits	    provides  information  about  pointer-like
       types
	  (C++11)		   (class template)

http://cppreference.com		  2022.07.31	      std::allocator_traits(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::allocator_traits&sektion=3&manpath=FreeBSD+Ports+15.0>

home | help