#include <growable_vector.h>
Public Types | |
typedef std::vector< T > | container_type |
typedef container_type::size_type | size_type |
Public Member Functions | |
T | operator[] (size_type index) const |
T & | operator[] (size_type index) |
growable_vector< T > & | operator+= (growable_vector< T > const &rhs) |
growable_vector< T > & | operator-= (growable_vector< T > const &rhs) |
size_type | size () const |
return current size of vector | |
void | fill (size_type size, T const &value) |
fill container with given value | |
bool | zero () const |
return true if all elements have the default constructed value | |
Private Attributes | |
container_type | container |
A simple growable vector template.
Definition at line 22 of file growable_vector.h.
typedef std::vector<T> growable_vector< T >::container_type |
Definition at line 24 of file growable_vector.h.
typedef container_type::size_type growable_vector< T >::size_type |
Definition at line 25 of file growable_vector.h.
void growable_vector< T >::fill | ( | size_type | size, | |
T const & | value | |||
) | [inline] |
fill container with given value
Definition at line 89 of file growable_vector.h.
growable_vector<T>& growable_vector< T >::operator+= | ( | growable_vector< T > const & | rhs | ) | [inline] |
vectorized += operator
Definition at line 54 of file growable_vector.h.
growable_vector<T>& growable_vector< T >::operator-= | ( | growable_vector< T > const & | rhs | ) | [inline] |
vectorized -= operator, overflow shouldn't occur during substraction (iow: for each components lhs[i] >= rhs[i]
Definition at line 70 of file growable_vector.h.
T& growable_vector< T >::operator[] | ( | size_type | index | ) | [inline] |
Index into the vector for a value. If the index is larger than the current max index, the array is expanded, default-filling any intermediary gaps.
Definition at line 44 of file growable_vector.h.
T growable_vector< T >::operator[] | ( | size_type | index | ) | const [inline] |
Index into the vector for a value. An out of bounds index will return a default-constructed value.
Definition at line 32 of file growable_vector.h.
size_type growable_vector< T >::size | ( | ) | const [inline] |
return current size of vector
Definition at line 83 of file growable_vector.h.
bool growable_vector< T >::zero | ( | ) | const [inline] |
return true if all elements have the default constructed value
Definition at line 95 of file growable_vector.h.
container_type growable_vector< T >::container [private] |
Definition at line 102 of file growable_vector.h.
Referenced by growable_vector< binary_info >::fill(), growable_vector< binary_info >::operator+=(), growable_vector< binary_info >::operator-=(), growable_vector< binary_info >::operator[](), growable_vector< binary_info >::size(), and growable_vector< binary_info >::zero().