|
| AllocVector (const AllocatorPtr &alloc) |
|
| AllocVector (const Allocatable &owner) |
|
| AllocVector (const AllocatorPtr &alloc, size_t n, const T &val) |
|
| AllocVector (const Allocatable &owner, size_t n, const T &val) |
|
template<class IteratorT > |
| AllocVector (const AllocatorPtr &alloc, IteratorT first, IteratorT last) |
|
template<class IteratorT > |
| AllocVector (const Allocatable &owner, IteratorT first, IteratorT last) |
|
template<typename ContainerT > |
| AllocVector (const AllocatorPtr &alloc, const ContainerT &from) |
| These constructors can be used to copy from "STL iterables": anything that provides a pair of compatible iterators via begin() and end(). More...
|
|
template<typename ContainerT > |
| AllocVector (const Allocatable &owner, const ContainerT &from) |
|
| AllocVector (const AllocatorPtr &alloc, std::initializer_list< T > init) |
| These constructors allow AllocVector to be initialized using c++11's list initialization: AllocVector<int> vector(allocator, {1, 2, 3, 4});. More...
|
|
| AllocVector (const Allocatable &owner, std::initializer_list< T > init) |
|
template<typename T>
class ion::base::AllocVector< T >
This class can be used in place of std::vector to allow an Ion Allocator to be used for memory allocation.
There is a constructor that takes the Allocator to be used as an argument. For example:
AllocVector<int> vec(allocator);
AllocVector also provides a convenience constructor to declare class members of a derived Allocatable class. It uses the same Allocator that was used for the Allocatable. For example:
class MyClass : public Allocatable { public: ///< The vector will use the same Allocator as the MyClass instance. MyClass() : member_vec_(*this) {} ... private: AllocVector<int> member_vec_; };
Definition at line 50 of file allocvector.h.