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
705  { // default construct
706  }
template<class _Ty , class _Sync >
template<class _Other >
stdext::allocators::allocator_base< _Ty, _Sync >::allocator_base ( const allocator_base< _Other, _Sync > &  _Right)
inline
710  : _Sync(_Right)
711  { // construct by copying x
712  }
constexpr const _Ty &() _Right
Definition: algorithm:3723

Member Function Documentation

template<class _Ty , class _Sync >
pointer stdext::allocators::allocator_base< _Ty, _Sync >::address ( reference  _Val)
inline
715  { // get address of _Val
716  return (&_Val);
717  }
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty , class _Sync >
const_pointer stdext::allocators::allocator_base< _Ty, _Sync >::address ( const_reference  _Val)
inline
720  { // get const address of _Val
721  return (&_Val);
722  }
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Ty , class _Sync >
template<class _Other >
_DECLSPEC_ALLOCATOR pointer stdext::allocators::allocator_base< _Ty, _Sync >::allocate ( size_type  _Nx,
const _Other *   
)
inline
726  { // allocate _Nx elements, ignore hint
727  return (allocate(_Nx));
728  }
_DECLSPEC_ALLOCATOR pointer allocate(size_type _Nx, const _Other *)
Definition: allocators:725
template<class _Ty , class _Sync >
_DECLSPEC_ALLOCATOR pointer stdext::allocators::allocator_base< _Ty, _Sync >::allocate ( size_type  _Nx)
inline
731  { // allocate array of _Nx elements
732  if (_Nx <= 0)
733  _Nx = 0;
734  else if (((size_t)(-1) / sizeof (_Ty) < _Nx))
735  _STD _Xbad_alloc();
736 
737  if (_Nx == 1)
738  return ((_Ty *)_Sync::allocate(sizeof (_Ty)));
739  else
740  return ((_Ty *)::operator new(_Nx * sizeof (_Ty)));
741  }
_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
769  { // construct _Objty(_Types...) at _Ptr
770  ::new ((void *)_Ptr) _Objty(_STD forward<_Types>(_Args)...);
771  }
constexpr _Ty && forward(typename remove_reference< _Ty >::type &_Arg) _NOEXCEPT
Definition: type_traits:1332
template<class _Ty , class _Sync >
void stdext::allocators::allocator_base< _Ty, _Sync >::deallocate ( pointer  _Ptr,
size_type  _Nx 
)
inline
744  { // deallocate array of _Nx elements
745  if (_Ptr == 0)
746  ;
747  else if (_Nx == 1)
748  _Sync::deallocate(_Ptr, sizeof (_Ty));
749  else
750  ::operator delete(_Ptr);
751  }
template<class _Ty , class _Sync >
template<class _Other >
void stdext::allocators::allocator_base< _Ty, _Sync >::destroy ( _Other *  _Ptr)
inline
776  { // destroy *_Ptr
777  _Ptr->~_Other();
778  }
template<class _Ty , class _Sync >
size_type stdext::allocators::allocator_base< _Ty, _Sync >::max_size ( ) const
inline
781  { // return maximum number of objects that could be allocated
782  return ((size_t)(-1) / sizeof (_Ty));
783  }

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