Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class allocator<>

boost::mpi::allocator<void> — Allocator specialization for void value types.

Synopsis

// In header: <boost/mpi/allocator.hpp>


class allocator<> {
public:
  // types
  typedef          ;        
  typedef    ;  
  typedef            ;     
  typedef     ;        // Holds the size of objects. 
  typedef  ;  // Holds the number of elements between two pointers. 
  typedef          ;        // A reference to an object of type T. 
  typedef    ;  // A reference to a constant object of type T. 

  // member classes/structs/unions
  
  struct rebind {
    // types
    typedef  ;
  };

  // construct/copy/destruct
  ();
  ~();

  // public member functions
   () ;
   (,  = );
   (, );
   () ;
   (, );
   ();
};

Description

The void specialization of allocator is useful only for rebinding to another, different value type.

allocator public construct/copy/destruct

  1. ();

    Default-construct an allocator.

  2. ~();

    Destroy an allocator.

allocator public member functions

  1.  ( x) ;

    Returns the address of object x.

  2.  ( n,  = );

    Allocate enough memory for n elements of type T.

    Parameters:

    n

    The number of elements for which memory should be allocated.

    Returns:

    a pointer to the newly-allocated memory

  3.  ( p, );

    Deallocate memory referred to by the pointer p.

    Parameters:

    p

    The pointer whose memory should be deallocated. This pointer shall have been returned from the allocate() function and not have already been freed.

  4.  () ;

    Returns the maximum number of elements that can be allocated with allocate().

  5.  ( p,  val);

    Construct a copy of val at the location referenced by p.

  6.  ( p);

    Destroy the object referenced by p.


PrevUpHomeNext