|
0.12.0
|
|
Freundlich's C++ toolkit |
A special vector class for pod types.
| T | Container's value_type. Has to be a POD type; see here for what this means. |
| A | The allocator. |
See the module documentation for more information.
Public Types | |
| typedef T | value_type |
| A type that represents the data type stored in a vector. | |
| typedef A | allocator_type |
| A type that represents the allocator class for the vector object. | |
| typedef A::size_type | size_type |
| A type that counts the number of elements in a vector. | |
| typedef A::difference_type | difference_type |
| A type that provides the difference between the addresses of two elements in a vector. | |
| typedef A::pointer | pointer |
| A type that provides a pointer to an element in a vector. | |
| typedef A::const_pointer | const_pointer |
A type that provides a pointer to a const element in a vector. | |
| typedef A::reference | reference |
| A type that provides a reference to an element stored in a vector. | |
| typedef A::const_reference | const_reference |
A type that provides a reference to a const element stored in a vector for reading and performing const operations. | |
| typedef pointer | iterator |
| A type that provides a random-access iterator that can read or modify any element in a vector. | |
| typedef const_pointer | const_iterator |
A type that provides a random-access iterator that can read a const element in a vector. | |
| typedef std::reverse_iterator < iterator > | reverse_iterator |
| A type that provides a random-access iterator that can read or modify any element in a reversed vector. | |
| typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
A type that provides a random-access iterator that can read any const element in the vector. | |
Public Member Functions | |
| iterator | begin () |
| Returns a random-access iterator to the first element in the container. | |
| const_iterator | begin () const |
| Returns a random-access iterator to the first element in the container. | |
| iterator | end () |
| Returns a random-access iterator that points just beyond the end of the vector. | |
| const_iterator | end () const |
| Returns a random-access iterator that points just beyond the end of the vector. | |
| reverse_iterator | rbegin () |
| Returns an iterator to the first element in a reversed vector. | |
| const_reverse_iterator | rbegin () const |
| Returns an iterator to the first element in a reversed vector. | |
| reverse_iterator | rend () |
| Returns an iterator to the end of a reversed vector. | |
| const_reverse_iterator | rend () const |
| Returns an iterator to the end of a reversed vector. | |
| const_iterator | cbegin () const |
| Returns a random-access const-iterator to the first element in the container. | |
| const_iterator | cend () const |
| Returns a random-access const-iterator that points just beyond the end of the vector. | |
| const_reverse_iterator | crbegin () const |
| Returns a const-iterator to the first element in a reversed vector. | |
| const_reverse_iterator | crend () const |
| Returns an iterator to the end of a reversed vector. | |
| reference | operator[] (size_type) |
| Returns a reference to the vector element at a specified position. | |
| const_reference | operator[] (size_type) const |
| Returns a reference to the vector element at a specified position. | |
| reference | at (size_type) |
| Returns a reference to the element at a specified location in the vector. | |
| const_reference | at (size_type) const |
| Returns a reference to the element at a specified location in the vector. | |
| reference | front () |
| Returns a reference to the first element in a vector. | |
| const_reference | front () const |
| Returns a reference to the first element in a vector. | |
| reference | back () |
| Returns a reference to the last element of the vector. | |
| const_reference | back () const |
| Returns a reference to the last element of the vector. | |
| pointer | data () |
| Returns the pointer to the store. | |
| const_pointer | data () const |
| Returns the pointer to the store. | |
| pointer | data_end () |
| Returns the pointer to the end of the store. | |
| const_pointer | data_end () const |
| Returns the pointer to the end of the store. | |
| raw_vector (A const &a=A()) | |
| Construct an empty vector using the specified allocator. | |
| raw_vector (size_type sz, A const &a=A()) | |
| Constructs an uninitialized vector. | |
| raw_vector (size_type sz, T const &t, A const &a=A()) | |
| Constructs an initialized vector. | |
| template<typename In > | |
| raw_vector (In beg, In end, A const &a=A()) | |
| Constructs a vector from an iterator range. | |
| raw_vector (raw_vector const &) | |
| ~raw_vector () | |
| raw_vector & | operator= (raw_vector const &) |
| template<typename In > | |
| void | assign (In beg, In end) |
| Erases a vector and copies the specified elements to the empty vector. | |
| void | assign (size_type n, T const &value) |
| Resizes a vector and copies the specified element to the new vector. | |
| void | push_back (T const &t) |
| Add an element to the end of the vector. | |
| void | pop_back () |
| Deletes the element at the end of the vector. | |
| void | clear () |
| Erases the elements of the vector. | |
| size_type | size () const |
| Returns the number of elements in the vector. | |
| bool | empty () const |
| Tests if the vector container is empty. | |
| size_type | max_size () const |
| Returns the maximum length of the vector. | |
| size_type | capacity () const |
| Returns the number of elements that the vector could contain without allocating more storage. | |
| void | swap (raw_vector &) |
| Exchanges the elements of two vectors. | |
| void | resize_uninitialized (size_type sz) |
| The same as resize but doesn't initialize the newly created elements (if any) | |
| void | resize (size_type sz, T const &value=T()) |
| Erases the elements of the vector. | |
| void | reserve (size_type sz) |
| Reserves a minimum length of storage for a vector object. | |
| allocator_type | get_allocator () const |
| Returns an object to the allocator class used by a vector. | |
| iterator | insert (iterator position, T const &t) |
| Inserts an element into the vector at a specified position. | |
| void | insert (iterator position, size_type n, T const &t) |
| Inserts copies of an element into the vector at a specified position. | |
| template<typename In > | |
| void | insert (iterator position, In beg, In end) |
| Inserts a range of elements into the vector at a specified position. | |
| iterator | erase (iterator position) |
| Erases the element given by the iterator. | |
| iterator | erase (iterator first, iterator last) |
| Erase a range of elements from the vector. | |
| void | shrink_to_fit () |
| Tries to shrink capacity() to fit size() | |
| void | free_memory () |
Destroy this vector completely, it will then have empty storage Equivalent to resize(0); shrink_to_fit(); | |
| typedef A fcppt::container::raw_vector< T, A >::allocator_type |
A type that represents the allocator class for the vector object.
| typedef const_pointer fcppt::container::raw_vector< T, A >::const_iterator |
A type that provides a random-access iterator that can read a const element in a vector.
| typedef A::const_pointer fcppt::container::raw_vector< T, A >::const_pointer |
A type that provides a pointer to a const element in a vector.
| typedef A::const_reference fcppt::container::raw_vector< T, A >::const_reference |
A type that provides a reference to a const element stored in a vector for reading and performing const operations.
| typedef std::reverse_iterator<const_iterator> fcppt::container::raw_vector< T, A >::const_reverse_iterator |
A type that provides a random-access iterator that can read any const element in the vector.
| typedef A::difference_type fcppt::container::raw_vector< T, A >::difference_type |
A type that provides the difference between the addresses of two elements in a vector.
| typedef pointer fcppt::container::raw_vector< T, A >::iterator |
A type that provides a random-access iterator that can read or modify any element in a vector.
| typedef A::pointer fcppt::container::raw_vector< T, A >::pointer |
A type that provides a pointer to an element in a vector.
| typedef A::reference fcppt::container::raw_vector< T, A >::reference |
A type that provides a reference to an element stored in a vector.
| typedef std::reverse_iterator<iterator> fcppt::container::raw_vector< T, A >::reverse_iterator |
A type that provides a random-access iterator that can read or modify any element in a reversed vector.
| typedef A::size_type fcppt::container::raw_vector< T, A >::size_type |
A type that counts the number of elements in a vector.
| typedef T fcppt::container::raw_vector< T, A >::value_type |
A type that represents the data type stored in a vector.
|
explicit |
Construct an empty vector using the specified allocator.
| a | The allocator |
|
explicit |
Constructs an uninitialized vector.
| sz | The initial size of the vector |
| a | The allocator All of the elements will have indeterminate values and must be written before being read. |
| fcppt::container::raw_vector< T, A >::raw_vector | ( | size_type | sz, |
| T const & | t, | ||
| A const & | a = A() |
||
| ) |
Constructs an initialized vector.
| sz | The initial size of the vector |
| t | The value to assign to all elements in the vector |
| a | The allocator |
| fcppt::container::raw_vector< T, A >::raw_vector | ( | In | beg, |
| In | end, | ||
| A const & | a = A() |
||
| ) |
Constructs a vector from an iterator range.
| In | A forward iterator type |
| beg | The begining of the iterator range |
| end | One past the end of the iterator range |
| a | The allocator |
| fcppt::container::raw_vector< T, A >::raw_vector | ( | raw_vector< T, A > const & | _other | ) |
| fcppt::container::raw_vector< T, A >::~raw_vector | ( | ) |
| void fcppt::container::raw_vector< T, A >::assign | ( | In | beg, |
| In | end | ||
| ) |
Erases a vector and copies the specified elements to the empty vector.
| In | A forward iterator type |
| beg | The begining of the iterator range |
| end | One past the end of the iterator range |
| void fcppt::container::raw_vector< T, A >::assign | ( | size_type | n, |
| T const & | value | ||
| ) |
Resizes a vector and copies the specified element to the new vector.
| n | The vector's new size |
| value | The value to assign to all the elements |
| fcppt::container::raw_vector< T, A >::reference fcppt::container::raw_vector< T, A >::at | ( | size_type | _index | ) |
Returns a reference to the element at a specified location in the vector.
| fcppt::container::out_of_range |
| fcppt::container::raw_vector< T, A >::const_reference fcppt::container::raw_vector< T, A >::at | ( | size_type | _index | ) | const |
Returns a reference to the element at a specified location in the vector.
| fcppt::container::out_of_range |
| fcppt::container::raw_vector< T, A >::reference fcppt::container::raw_vector< T, A >::back | ( | ) |
Returns a reference to the last element of the vector.
| fcppt::container::raw_vector< T, A >::const_reference fcppt::container::raw_vector< T, A >::back | ( | ) | const |
Returns a reference to the last element of the vector.
| fcppt::container::raw_vector< T, A >::iterator fcppt::container::raw_vector< T, A >::begin | ( | ) |
Returns a random-access iterator to the first element in the container.
| fcppt::container::raw_vector< T, A >::const_iterator fcppt::container::raw_vector< T, A >::begin | ( | ) | const |
Returns a random-access iterator to the first element in the container.
| fcppt::container::raw_vector< T, A >::size_type fcppt::container::raw_vector< T, A >::capacity | ( | ) | const |
Returns the number of elements that the vector could contain without allocating more storage.
| fcppt::container::raw_vector< T, A >::const_iterator fcppt::container::raw_vector< T, A >::cbegin | ( | ) | const |
Returns a random-access const-iterator to the first element in the container.
std::vector | fcppt::container::raw_vector< T, A >::const_iterator fcppt::container::raw_vector< T, A >::cend | ( | ) | const |
Returns a random-access const-iterator that points just beyond the end of the vector.
std::vector | void fcppt::container::raw_vector< T, A >::clear | ( | ) |
Erases the elements of the vector.
| fcppt::container::raw_vector< T, A >::const_reverse_iterator fcppt::container::raw_vector< T, A >::crbegin | ( | ) | const |
Returns a const-iterator to the first element in a reversed vector.
std::vector | fcppt::container::raw_vector< T, A >::const_reverse_iterator fcppt::container::raw_vector< T, A >::crend | ( | ) | const |
Returns an iterator to the end of a reversed vector.
std::vector | fcppt::container::raw_vector< T, A >::pointer fcppt::container::raw_vector< T, A >::data | ( | ) |
Returns the pointer to the store.
May return 0 if the vector is empty.
std::vector | fcppt::container::raw_vector< T, A >::const_pointer fcppt::container::raw_vector< T, A >::data | ( | ) | const |
Returns the pointer to the store.
May return 0 if the vector is empty.
std::vector | fcppt::container::raw_vector< T, A >::pointer fcppt::container::raw_vector< T, A >::data_end | ( | ) |
| fcppt::container::raw_vector< T, A >::const_pointer fcppt::container::raw_vector< T, A >::data_end | ( | ) | const |
| bool fcppt::container::raw_vector< T, A >::empty | ( | ) | const |
Tests if the vector container is empty.
| fcppt::container::raw_vector< T, A >::iterator fcppt::container::raw_vector< T, A >::end | ( | ) |
Returns a random-access iterator that points just beyond the end of the vector.
| fcppt::container::raw_vector< T, A >::const_iterator fcppt::container::raw_vector< T, A >::end | ( | ) | const |
Returns a random-access iterator that points just beyond the end of the vector.
| fcppt::container::raw_vector< T, A >::iterator fcppt::container::raw_vector< T, A >::erase | ( | iterator | position | ) |
Erases the element given by the iterator.
| position | The iterator to the element to delete |
| fcppt::container::raw_vector< T, A >::iterator fcppt::container::raw_vector< T, A >::erase | ( | iterator | first, |
| iterator | last | ||
| ) |
Erase a range of elements from the vector.
| first | The begining of the iterator range |
| last | One past the end of the iterator range |
end | void fcppt::container::raw_vector< T, A >::free_memory | ( | ) |
Destroy this vector completely, it will then have empty storage Equivalent to resize(0); shrink_to_fit();
std::vector | fcppt::container::raw_vector< T, A >::reference fcppt::container::raw_vector< T, A >::front | ( | ) |
Returns a reference to the first element in a vector.
| fcppt::container::raw_vector< T, A >::const_reference fcppt::container::raw_vector< T, A >::front | ( | ) | const |
Returns a reference to the first element in a vector.
| fcppt::container::raw_vector< T, A >::allocator_type fcppt::container::raw_vector< T, A >::get_allocator | ( | ) | const |
Returns an object to the allocator class used by a vector.
| fcppt::container::raw_vector< T, A >::iterator fcppt::container::raw_vector< T, A >::insert | ( | iterator | position, |
| T const & | t | ||
| ) |
Inserts an element into the vector at a specified position.
| position | An iterator to the element after the new element |
| t | The new element |
| void fcppt::container::raw_vector< T, A >::insert | ( | iterator | position, |
| size_type | n, | ||
| T const & | t | ||
| ) |
Inserts copies of an element into the vector at a specified position.
| position | An iterator to the element after the new elements |
| n | How many copies to insert |
| t | The new element |
| void fcppt::container::raw_vector< T, A >::insert | ( | iterator | position, |
| In | beg, | ||
| In | end | ||
| ) |
Inserts a range of elements into the vector at a specified position.
| In | A forward iterator type |
| position | An iterator to the element after the new elements |
| beg | The begining of the iterator range |
| end | One past the end of the iterator range |
| fcppt::container::raw_vector< T, A >::size_type fcppt::container::raw_vector< T, A >::max_size | ( | ) | const |
Returns the maximum length of the vector.
| fcppt::container::raw_vector< T, A > & fcppt::container::raw_vector< T, A >::operator= | ( | raw_vector< T, A > const & | _other | ) |
| fcppt::container::raw_vector< T, A >::reference fcppt::container::raw_vector< T, A >::operator[] | ( | size_type | _index | ) |
Returns a reference to the vector element at a specified position.
| fcppt::container::raw_vector< T, A >::const_reference fcppt::container::raw_vector< T, A >::operator[] | ( | size_type | _index | ) | const |
Returns a reference to the vector element at a specified position.
| void fcppt::container::raw_vector< T, A >::pop_back | ( | ) |
Deletes the element at the end of the vector.
| void fcppt::container::raw_vector< T, A >::push_back | ( | T const & | t | ) |
Add an element to the end of the vector.
| t | The element to add |
| fcppt::container::raw_vector< T, A >::reverse_iterator fcppt::container::raw_vector< T, A >::rbegin | ( | ) |
Returns an iterator to the first element in a reversed vector.
| fcppt::container::raw_vector< T, A >::const_reverse_iterator fcppt::container::raw_vector< T, A >::rbegin | ( | ) | const |
Returns an iterator to the first element in a reversed vector.
| fcppt::container::raw_vector< T, A >::reverse_iterator fcppt::container::raw_vector< T, A >::rend | ( | ) |
Returns an iterator to the end of a reversed vector.
| fcppt::container::raw_vector< T, A >::const_reverse_iterator fcppt::container::raw_vector< T, A >::rend | ( | ) | const |
Returns an iterator to the end of a reversed vector.
| void fcppt::container::raw_vector< T, A >::reserve | ( | size_type | sz | ) |
Reserves a minimum length of storage for a vector object.
| sz | The new (storage) size |
| void fcppt::container::raw_vector< T, A >::resize | ( | size_type | sz, |
| T const & | value = T() |
||
| ) |
Erases the elements of the vector.
| sz | The new size |
| value | The value to assign to the new elements (if any) |
| void fcppt::container::raw_vector< T, A >::resize_uninitialized | ( | size_type | sz | ) |
The same as resize but doesn't initialize the newly created elements (if any)
std::vector | void fcppt::container::raw_vector< T, A >::shrink_to_fit | ( | ) |
Tries to shrink capacity() to fit size()
std::vector | fcppt::container::raw_vector< T, A >::size_type fcppt::container::raw_vector< T, A >::size | ( | ) | const |
Returns the number of elements in the vector.
| void fcppt::container::raw_vector< T, A >::swap | ( | raw_vector< T, A > & | _other | ) |
Exchanges the elements of two vectors.
1.8.2