|
Cuda battery library
|
#include <vector.hpp>
Public Types | |
| using | value_type = T |
| using | allocator_type = Allocator |
| using | this_type = vector<value_type, allocator_type> |
Public Member Functions | |
| CUDA NI | vector (size_t n, const allocator_type &alloc=allocator_type()) |
| CUDA | vector (const allocator_type &alloc=allocator_type{}) |
| template<class U> | |
| CUDA NI | vector (const U *from, size_t n, const allocator_type &alloc=allocator_type{}) |
| template<class U, class Allocator2> | |
| CUDA | vector (const vector< U, Allocator2 > &from, const allocator_type &alloc=allocator_type{}) |
| template<class U> | |
| CUDA | vector (const vector< U, allocator_type > &from) |
| CUDA | vector (const this_type &from) |
| template<class U> | |
| CUDA NI | vector (size_t n, const U &from, const allocator_type &alloc=allocator_type{}) |
| CUDA NI | vector (this_type &&other) |
| CUDA NI | vector (std::initializer_list< T > init, const allocator_type &alloc=allocator_type{}) |
| template<class U, class Alloc2> | |
| vector (const std::vector< U, Alloc2 > &other, const allocator_type &alloc=allocator_type{}) | |
| CUDA NI | ~vector () |
| CUDA this_type & | operator= (this_type &&other) |
| CUDA NI this_type & | operator= (const this_type &other) |
| template<class U, class Allocator2> | |
| CUDA NI this_type & | operator= (const vector< U, Allocator2 > &other) |
| CUDA allocator_type | get_allocator () const |
| CUDA value_type & | operator[] (size_t i) |
| CUDA const value_type & | operator[] (size_t i) const |
| CUDA value_type & | front () |
| CUDA const value_type & | front () const |
| CUDA value_type & | back () |
| CUDA const value_type & | back () const |
| CUDA value_type * | data () |
| CUDA const value_type * | data () const |
| CUDA bool | empty () const |
| CUDA size_t | size () const |
| CUDA void | reserve (size_t new_cap) |
| CUDA size_t | capacity () const |
| CUDA void | shrink_to_fit () |
| CUDA NI void | clear () |
| CUDA void | push_back (const T &value) |
| CUDA void | push_back (T &&value) |
| template<class... Args> | |
| CUDA value_type & | emplace_back (Args &&... args) |
| CUDA void | pop_back () |
| CUDA NI void | resize (size_t count) |
| CUDA void | swap (this_type &other) |
| CUDA NI void | print () const |
Friends | |
| template<class T2, class Allocator2> | |
| class | vector |
| using battery::vector< T, Allocator >::value_type = T |
| using battery::vector< T, Allocator >::allocator_type = Allocator |
| using battery::vector< T, Allocator >::this_type = vector<value_type, allocator_type> |
|
inline |
Allocate an array of size n using allocator, with n default-inserted instances of T. Allocator is scoped, meaning it will be passed to the constructor of T if T(const Allocator&) exists, otherwise T() is called.
|
inline |
Default constructor.
|
inline |
Allocate an array of size n using allocator. Initialize the elements of the array with those of the array from. Allocator is scoped, meaning it will be passed to the constructor of T if T(const T&, const Allocator&) exists, otherwise T(const T&) is called.
|
inline |
Copy constructor with an allocator, useful when the vector we copied from was declared using another allocator.
|
inline |
Copy constructor with different underlying types.
|
inline |
Redefine the copy constructor to be sure it calls a constructor with an allocator.
|
inline |
Initialize of an array of size n with each element initialized to from using allocator. Allocator is scoped, meaning it will be passed to the constructor of T if T(const T&, const Allocator&) exists, otherwise T(const T&) is called.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Beware that this operator does not free the memory of this, the capacity remains unchanged.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |