|
cds
2.3.2
|
Extends std::allocator interface to provide semantics like operator new and delete.
More...
#include <cds/details/allocator.h>
Data Structures | |
| struct | rebind |
Rebinds allocator to other type Q instead of T. More... | |
Public Types | |
| typedef std::conditional< std::is_same< T, typename Alloc::value_type >::value, Alloc, typename Alloc::template rebind< T >::other >::type | allocator_type |
| Underlying allocator type. | |
| typedef T | value_type |
| Element type. | |
Public Member Functions | |
| template<typename... S> | |
| value_type * | New (S const &... src) |
Analogue of operator new T(src... ) | |
| template<typename... Args> | |
| value_type * | MoveNew (Args &&... args) |
Analogue of operator new T( std::forward<Args>(args)... ) (move semantics) | |
| value_type * | NewArray (size_t nCount) |
Analogue of operator new T[nCount ]. | |
| template<typename S > | |
| value_type * | NewArray (size_t nCount, S const &src) |
Analogue of operator new T[nCount ]. More... | |
| template<typename... S> | |
| value_type * | NewBlock (size_t nSize, S const &... src) |
Allocates block of memory of size at least nSize bytes. More... | |
| void | Delete (value_type *p) |
| Analogue of operator delete. | |
| void | Delete (value_type *p, size_t nCount) |
| Analogue of operator delete []. | |
| template<typename... S> | |
| value_type * | Construct (void *p, S const &... src) |
Analogue of placement operator new( p ) T( src... ) | |
| template<typename... Args> | |
| value_type * | MoveConstruct (void *p, Args &&... args) |
Analogue of placement operator new( p ) T( std::forward<Args>(args)... ) | |
Static Public Attributes | |
| static constexpr bool const | c_bStdAllocator = std::is_same< allocator_type, std::allocator<T>>::value |
true if underlined allocator is std::allocator, false otherwise | |
Extends std::allocator interface to provide semantics like operator new and delete.
The class is the wrapper around underlying Alloc class. Alloc provides the std::allocator interface.
|
inline |
Analogue of operator new T[nCount ].
Each item of array of type T is initialized by parameter src: T( src )
|
inline |
Allocates block of memory of size at least nSize bytes.
Internally, the block is allocated as an array of void* pointers, then Construct() method is called to initialize T.
Precondition: nSize >= sizeof(T)