STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | List of all members
stdext::allocators::allocator_base< _Ty, _Sync > Class Template Reference
Inheritance diagram for stdext::allocators::allocator_base< _Ty, _Sync >:

Public Types

typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef _Ty * pointer
 
typedef const _Ty * const_pointer
 
typedef voidvoid_pointer
 
typedef const voidconst_void_pointer
 
typedef _Ty & reference
 
typedef const _Ty & const_reference
 
typedef _Ty value_type
 

Public Member Functions

 allocator_base ()
 
template<class _Other >
 allocator_base (const allocator_base< _Other, _Sync > &_Right)
 
pointer address (reference _Val)
 
const_pointer address (const_reference _Val)
 
template<class _Other >
_DECLSPEC_ALLOCATOR pointer allocate (size_type _Nx, const _Other *)
 
_DECLSPEC_ALLOCATOR pointer allocate (size_type _Nx)
 
void deallocate (pointer _Ptr, size_type _Nx)
 
template<class _Objty , class... _Types>
void construct (_Objty *_Ptr, _Types &&..._Args)
 
template<class _Other >
void destroy (_Other *_Ptr)
 
size_type max_size () const
 

Member Typedef Documentation

template<class _Ty , class _Sync >
typedef const _Ty* stdext::allocators::allocator_base< _Ty, _Sync >::const_pointer
template<class _Ty , class _Sync >
typedef const _Ty& stdext::allocators::allocator_base< _Ty, _Sync >::const_reference
template<class _Ty , class _Sync >
typedef const void* stdext::allocators::allocator_base< _Ty, _Sync >::const_void_pointer
template<class _Ty , class _Sync >
typedef ptrdiff_t stdext::allocators::allocator_base< _Ty, _Sync >::difference_type
template<class _Ty , class _Sync >
typedef _Ty* stdext::allocators::allocator_base< _Ty, _Sync >::pointer
template<class _Ty , class _Sync >
typedef _Ty& stdext::allocators::allocator_base< _Ty, _Sync >::reference
template<class _Ty , class _Sync >
typedef size_t stdext::allocators::allocator_base< _Ty, _Sync >::size_type
template<class _Ty , class _Sync >
typedef _Ty stdext::allocators::allocator_base< _Ty, _Sync >::value_type
template<class _Ty , class _Sync >
typedef void* stdext::allocators::allocator_base< _Ty, _Sync >::void_pointer

Constructor & Destructor Documentation

template<class _Ty , class _Sync >
stdext::allocators::allocator_base< _Ty, _Sync >::allocator_base ( )
inline
701  { // default construct
702  }
template<class _Ty , class _Sync >
template<class _Other >
stdext::allocators::allocator_base< _Ty, _Sync >::allocator_base ( const allocator_base< _Other, _Sync > &  _Right)
inline
706  : _Sync(_Right)
707  { // construct by copying x
708  }
constexpr const _Ty &() _Right
Definition: algorithm:3591

Member Function Documentation

template<class _Ty , class _Sync >
pointer stdext::allocators::allocator_base< _Ty, _Sync >::address ( reference  _Val)
inline
711  { // get address of _Val
712  return (&_Val);
713  }
_In_ int _Val
Definition: vcruntime_string.h:62
template<class _Ty , class _Sync >
const_pointer stdext::allocators::allocator_base< _Ty, _Sync >::address ( const_reference  _Val)
inline
716  { // get const address of _Val
717  return (&_Val);
718  }
_In_ int _Val
Definition: vcruntime_string.h:62
template<class _Ty , class _Sync >
template<class _Other >
_DECLSPEC_ALLOCATOR pointer stdext::allocators::allocator_base< _Ty, _Sync >::allocate ( size_type  _Nx,
const _Other *   
)
inline
722  { // allocate _Nx elements, ignore hint
723  return (allocate(_Nx));
724  }
_DECLSPEC_ALLOCATOR pointer allocate(size_type _Nx, const _Other *)
Definition: allocators:721
template<class _Ty , class _Sync >
_DECLSPEC_ALLOCATOR pointer stdext::allocators::allocator_base< _Ty, _Sync >::allocate ( size_type  _Nx)
inline
727  { // allocate array of _Nx elements
728  if (_Nx <= 0)
729  _Nx = 0;
730  else if (((size_t)(-1) / sizeof (_Ty) < _Nx))
731  _STD _Xbad_alloc();
732 
733  if (_Nx == 1)
734  return ((_Ty *)_Sync::allocate(sizeof (_Ty)));
735  else
736  return ((_Ty *)::operator new(_Nx * sizeof (_Ty)));
737  }
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xbad_alloc()
template<class _Ty , class _Sync >
template<class _Objty , class... _Types>
void stdext::allocators::allocator_base< _Ty, _Sync >::construct ( _Objty *  _Ptr,
_Types &&...  _Args 
)
inline
765  { // construct _Objty(_Types...) at _Ptr
766  ::new ((void *)_Ptr) _Objty(_STD forward<_Types>(_Args)...);
767  }
constexpr _Ty && forward(typename remove_reference< _Ty >::type &_Arg) _NOEXCEPT
Definition: type_traits:1273
template<class _Ty , class _Sync >
void stdext::allocators::allocator_base< _Ty, _Sync >::deallocate ( pointer  _Ptr,
size_type  _Nx 
)
inline
740  { // deallocate array of _Nx elements
741  if (_Ptr == 0)
742  ;
743  else if (_Nx == 1)
744  _Sync::deallocate(_Ptr, sizeof (_Ty));
745  else
746  ::operator delete(_Ptr);
747  }
template<class _Ty , class _Sync >
template<class _Other >
void stdext::allocators::allocator_base< _Ty, _Sync >::destroy ( _Other *  _Ptr)
inline
772  { // destroy *_Ptr
773  (void) _Ptr;
774  _Ptr->~_Other();
775  }
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *unexpected_handler)()
template<class _Ty , class _Sync >
size_type stdext::allocators::allocator_base< _Ty, _Sync >::max_size ( ) const
inline
778  { // return maximum number of objects that could be allocated
779  return ((size_t)(-1) / sizeof (_Ty));
780  }

The documentation for this class was generated from the following file: