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

FreeBSD Manual Pages

  
 
  

home | help
std::experi...rce_adaptor(3)  C++ Standard Libary std::experi...rce_adaptor(3)

NAME
       std::experimental::pmr::resource_adaptor	 - std::experimental::pmr::re-
       source_adaptor

Synopsis
	  Defined in header <experimental/memory_resource>
	  template< class Alloc	>

	  using	resource_adaptor = /*resource-adaptor-imp*/<		  (li-
       brary fundamentals
	  typename std::allocator_traits<Allocator>::			 TS)

	  template rebind_alloc<char>>;
	  template<  class Alloc >					  (li-
       brary fundamentals
	  class	/*resource-adaptor-imp*/ : public memory_resource; //	 TS)
	  for exposition only

	  The alias template resource_adaptor adapts the allocator type	 Alloc
       with a
	  memory_resource  interface. The allocator is rebound to a char value
       type before it
	  is actually adapted (using the resource-adaptor-imp class template),
       so that
	  adapting specializations  of	the  same  allocator  template	always
       yields the same type,
	  regardless  of  the  value type the allocator	template is originally
       instantiated with.

	  resource-adaptor-imp is a class template whose members are described
       below. The name
	  resource-adaptor-imp is for exposition purposes only and not	norma-
       tive.

	  In  addition	to  meeting the	Allocator requirements,	Allocator must
       additionally
	  satisfy the following	requirements:

	    * std::allocator_traits<Alloc>::pointer shall be identical to  Al-
       loc::value_type*.
	    *  std::allocator_traits<Alloc>::const_pointer  shall be identical
       to
	      Alloc::value_type	const*.
	    * std::allocator_traits<Alloc>::void_pointer shall be identical to
       void*.
	    * std::allocator_traits<Alloc>::const_const_pointer	shall be iden-
       tical to	void
	      const*.

	  The  type  memory_resorce  in	 this  page  denotes   std::experimen-
       tal::pmr::memory_resource
	  in  LFTS v1 and v2, but denotes std::pmr::memory_resource since LFTS
       v3.

	 Member	types of resource-adaptor-imp

	  Member type	 Definition
	  allocator_type Alloc

	 Member	functions of resource-adaptor-imp

       resource-adaptor-imp::resource-adaptor-imp

	  /*resource-adaptor-imp*/() =	default;			   (1)
       (library
									     fun-
       damentals TS)
	  /*resource-adaptor-imp*/(const	     /*resource-adaptor-imp*/&
       (library
	  other)							   (2)
       fundamentals TS)
	  = default;
	  /*resource-adaptor-imp*/(/*resource-adaptor-imp*/&&  other)	   (3)
       (library
	  =							      default;
       fundamentals TS)
	  explicit  /*resource-adaptor-imp*/(const  Alloc& a2);		   (4)
       (library
									     fun-
       damentals TS)
	  explicit /*resource-adaptor-imp*/(Alloc&&  a2);		   (5)
       (library
									     fun-
       damentals TS)

	  1) Default constructor. Default constructs the wrapped allocator.
	  2)  Copy constructor.	Copy constructs	the wrapped allocator from the
       allocator
	  wrapped by other.
	  3) Move constructor. Move constructs the wrapped allocator from  the
       allocator
	  wrapped by other.
	  4) Initializes the wrapped allocator with a2.
	  5) Initializes the wrapped allocator with std::move(a2).

Parameters
	  other	- another resource-adaptor-imp object to copy or move from
	  a2	- another Alloc	object to copy or move from

       resource-adaptor-imp::get_allocator

	  allocator_type get_allocator() const;	 (library fundamentals TS)

	  Returns a copy of the	wrapped	allocator.

       resource-adaptor-imp::operator=

	  /*resource-adaptor-imp*/& operator=(const
	  /*resource-adaptor-imp*/&  other)			      (library
       fundamentals TS)
	  = default;

	  Defaulted copy assignment operator. Copy assigns the wrapped alloca-
       tor from	that of
	  other.

       resource-adaptor-imp::do_allocate

	  protected:
	  virtual void*	do_allocate(std::size_t	bytes, std::size_t    (library
       fundamentals TS)
	  alignment);

	  Allocates  memory  using the allocate	member function	of the wrapped
       allocator.

       resource-adaptor-imp::do_deallocate

	  protected:
	  virtual void do_deallocate(void *p, std::size_t bytes,      (library
       fundamentals TS)
	  std::size_t alignment);

	  Deallocates  the storage pointed to by p using the deallocate	member
       function	of the
	  wrapped allocator.

	  p must have been allocated using the allocate	member function	of  an
       allocator that
	  compares equal to the	wrapped	allocator, and must not	have been sub-
       sequently
	  deallocated.

       resource-adaptor-imp::do_is_equal

	  protected:
	  virtual  bool	do_is_equal(const memory_resource& other)     (library
       fundamentals TS)
	  const	noexcept;

	  Let p	be dynamic_cast<const /*resource-adaptor-imp*/*>(&other). If p
       is a null
	  pointer value, returns false.	Otherwise, return the result  of  com-
       paring the
	  allocators wrapped by	*p and *this using operator==.

http://cppreference.com		  2022.07.31	  std::experi...rce_adaptor(3)

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

home | help