#include <vector.hpp>
|
| vector (const allocator_type &allocator=allocator_type()) |
|
| vector (size_type initialSize, const allocator_type &allocator=allocator_type()) |
|
| vector (const T *first, const T *last, const allocator_type &allocator=allocator_type()) |
|
| vector (const vector &rhs, const allocator_type &allocator=allocator_type()) |
|
| vector (e_noinitialize n) |
|
| ~vector () |
|
vector & | operator= (const vector &rhs) |
|
void | copy (const vector &rhs) |
|
iterator | begin () |
|
const_iterator | begin () const |
|
iterator | end () |
|
const_iterator | end () const |
|
size_type | size () const |
|
bool | empty () const |
|
size_type | capacity () const |
|
T * | data () |
|
const T * | data () const |
|
T & | front () |
|
const T & | front () const |
|
T & | back () |
|
const T & | back () const |
|
T & | operator[] (size_type i) |
|
const T & | operator[] (size_type i) const |
|
T & | at (size_type i) |
|
const T & | at (size_type i) const |
|
void | push_back (const T &v) |
|
void | push_back () |
|
void | pop_back () |
|
void | assign (const T *first, const T *last) |
|
void | insert (size_type index, size_type n, const T &val) |
|
void | insert (iterator it, size_type n, const T &val) |
|
iterator | insert (iterator it, const T &val) |
|
iterator | erase (iterator it) |
|
iterator | erase (iterator first, iterator last) |
|
void | erase_unostdred (iterator it) |
|
void | resize (size_type n) |
|
void | reserve (size_type n) |
|
void | clear () |
|
void | reset () |
|
void | set_capacity (size_type newCapacity) |
|
size_type | index_of (const T &item, size_type index=0) const |
|
iterator | find (const T &item) |
|
const allocator_type & | get_allocator () const |
|
void | set_allocator (const allocator_type &allocator) |
|
bool | validate_iterator (const_iterator it) const |
|
size_type | get_high_watermark () const |
|
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
class std::vector< T, TAllocator, TStorage >
◆ allocator_type
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
◆ const_iterator
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
◆ iterator
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
◆ size_type
◆ value_type
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
◆ vector() [1/5]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
129 : TStorage(allocator)
◆ vector() [2/5]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
133 : TStorage(allocator)
void resize(size_type n)
Definition: vector.hpp:430
◆ vector() [3/5]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
138 : TStorage(allocator)
void assign(const T *first, const T *last)
Definition: vector.hpp:290
◆ vector() [4/5]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
143 : TStorage(allocator)
147 this->reallocate_discard_old(rhs.capacity());
149 m_end = m_begin + rhs.size();
150 TStorage::record_high_watermark();
void copy_construct_n(T *first, size_t n, T *result)
Definition: algorithm.hpp:43
◆ vector() [5/5]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
◆ ~vector()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
159 if (TStorage::m_begin != 0)
160 TStorage::destroy(TStorage::m_begin,
size());
size_type size() const
Definition: vector.hpp:197
◆ assign()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
void std::vector< T, TAllocator, TStorage >::assign |
( |
const T * |
first, |
|
|
const T * |
last |
|
) |
| |
|
inline |
298 if (m_begin + count > m_capacityEnd)
299 reallocate_discard_old(compute_new_capacity(count));
302 m_end = m_begin + count;
303 TStorage::record_high_watermark();
int size_type
Definition: vector.hpp:43
void copy_n(const T *first, size_t n, T *result)
Definition: algorithm.hpp:35
void clear()
Definition: vector.hpp:442
bool validate_iterator(const_iterator it) const
Definition: vector.hpp:484
◆ at() [1/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
size_type size() const
Definition: vector.hpp:197
◆ at() [2/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
size_type size() const
Definition: vector.hpp:197
◆ back() [1/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
bool empty() const
Definition: vector.hpp:201
iterator end()
Definition: vector.hpp:189
◆ back() [2/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
const T& std::vector< T, TAllocator, TStorage >::back |
( |
| ) |
const |
|
inline |
bool empty() const
Definition: vector.hpp:201
iterator end()
Definition: vector.hpp:189
◆ begin() [1/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
◆ begin() [2/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
◆ capacity()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
207 return size_type(m_capacityEnd - m_begin);
int size_type
Definition: vector.hpp:43
◆ clear()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
◆ copy()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
void std::vector< T, TAllocator, TStorage >::copy |
( |
const vector< T, TAllocator, TStorage > & |
rhs | ) |
|
|
inline |
173 reallocate_discard_old(rhs.capacity());
176 m_end = m_begin + newSize;
177 TStorage::record_high_watermark();
void copy_construct_n(T *first, size_t n, T *result)
Definition: algorithm.hpp:43
size_type capacity() const
Definition: vector.hpp:205
int size_type
Definition: vector.hpp:43
◆ data() [1/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
212 return empty() ? 0 : m_begin;
bool empty() const
Definition: vector.hpp:201
◆ data() [2/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
const T* std::vector< T, TAllocator, TStorage >::data |
( |
| ) |
const |
|
inline |
216 return empty() ? 0 : m_begin;
bool empty() const
Definition: vector.hpp:201
◆ empty()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
bool std::vector< T, TAllocator, TStorage >::empty |
( |
| ) |
const |
|
inline |
203 return m_begin == m_end;
◆ end() [1/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
◆ end() [2/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
◆ erase() [1/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
Definition: type_traits.hpp:45
void destruct(T *mem)
Definition: algorithm.hpp:31
bool validate_iterator(const_iterator it) const
Definition: vector.hpp:484
iterator end()
Definition: vector.hpp:189
◆ erase() [2/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
414 shrink(
size() - toRemove);
416 return m_begin + indexFirst;
size_type size() const
Definition: vector.hpp:197
Definition: type_traits.hpp:45
int size_type
Definition: vector.hpp:43
bool validate_iterator(const_iterator it) const
Definition: vector.hpp:484
iterator end()
Definition: vector.hpp:189
◆ erase_unostdred()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
T * iterator
Definition: vector.hpp:123
void pop_back()
Definition: vector.hpp:283
bool validate_iterator(const_iterator it) const
Definition: vector.hpp:484
iterator end()
Definition: vector.hpp:189
◆ find()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
iterator begin()
Definition: vector.hpp:181
T * iterator
Definition: vector.hpp:123
iterator end()
Definition: vector.hpp:189
◆ front() [1/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
iterator begin()
Definition: vector.hpp:181
bool empty() const
Definition: vector.hpp:201
◆ front() [2/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
const T& std::vector< T, TAllocator, TStorage >::front |
( |
| ) |
const |
|
inline |
iterator begin()
Definition: vector.hpp:181
bool empty() const
Definition: vector.hpp:201
◆ get_allocator()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
◆ get_high_watermark()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
490 return TStorage::get_high_watermark();
◆ index_of()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
460 assert(index >= 0 && index <
size());
461 for ( ; index <
size(); ++index)
462 if (m_begin[index] == item)
size_type size() const
Definition: vector.hpp:197
static const size_type npos
Definition: vector.hpp:44
◆ insert() [1/3]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
312 if (m_end + n > m_capacityEnd)
314 reallocate(compute_new_capacity(prevSize + n), prevSize);
316 if (indexEnd > prevSize)
318 const size_type numCopy = prevSize - index;
319 const size_type numAppend = indexEnd - prevSize;
320 assert(numCopy >= 0 && numAppend >= 0);
321 assert(numAppend + numCopy == n);
322 iterator itOut = m_begin + prevSize;
323 for (
size_type i = 0; i < numAppend; ++i, ++itOut)
327 m_begin[index + i] = val;
332 iterator insertPos = m_begin + index;
333 std::move_n(insertPos, prevSize - indexEnd, insertPos + n);
338 TStorage::record_high_watermark();
size_type size() const
Definition: vector.hpp:197
void copy_construct_n(T *first, size_t n, T *result)
Definition: algorithm.hpp:43
void copy_construct(T *mem, const T &orig)
Definition: algorithm.hpp:23
T * iterator
Definition: vector.hpp:123
int size_type
Definition: vector.hpp:43
void move_n(const T *from, size_t n, T *result)
Definition: algorithm.hpp:47
◆ insert() [2/3]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
void insert(size_type index, size_type n, const T &val)
Definition: vector.hpp:307
int size_type
Definition: vector.hpp:43
bool validate_iterator(const_iterator it) const
Definition: vector.hpp:484
◆ insert() [3/3]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
353 if (m_end == m_capacityEnd)
356 it = m_begin + index;
368 assert(index <= prevSize);
369 const size_type toMove = prevSize - index;
376 const size_t n =
reinterpret_cast<uintptr_t
>(m_end) - reinterpret_cast<uintptr_t>(it);
383 TStorage::record_high_watermark();
size_type size() const
Definition: vector.hpp:197
void construct(T *mem)
Definition: algorithm.hpp:27
Definition: type_traits.hpp:45
int size_type
Definition: vector.hpp:43
bool validate_iterator(const_iterator it) const
Definition: vector.hpp:484
static void MemMove(void *to, const void *from, size_t bytes)
Definition: PLATFORM.cpp:43
void move_n(const T *from, size_t n, T *result, int_to_type< false >)
Definition: utility.hpp:92
◆ operator=()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
void copy(const vector &rhs)
Definition: vector.hpp:168
◆ operator[]() [1/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
T & at(size_type i)
Definition: vector.hpp:250
◆ operator[]() [2/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
T & at(size_type i)
Definition: vector.hpp:250
◆ pop_back()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
void std::vector< T, TAllocator, TStorage >::pop_back |
( |
| ) |
|
|
inline |
bool empty() const
Definition: vector.hpp:201
void destruct(T *mem)
Definition: algorithm.hpp:31
◆ push_back() [1/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
void std::vector< T, TAllocator, TStorage >::push_back |
( |
const T & |
v | ) |
|
|
inline |
264 if (m_end < m_capacityEnd)
273 TStorage::record_high_watermark();
void copy_construct(T *mem, const T &orig)
Definition: algorithm.hpp:23
◆ push_back() [2/2]
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
void std::vector< T, TAllocator, TStorage >::push_back |
( |
| ) |
|
|
inline |
277 if (m_end == m_capacityEnd)
281 TStorage::record_high_watermark();
void construct(T *mem)
Definition: algorithm.hpp:27
◆ reserve()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
440 reallocate(n,
size());
size_type size() const
Definition: vector.hpp:197
size_type capacity() const
Definition: vector.hpp:205
◆ reset()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
◆ resize()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
size_type size() const
Definition: vector.hpp:197
void insert(size_type index, size_type n, const T &val)
Definition: vector.hpp:307
T value_type
Definition: vector.hpp:122
◆ set_allocator()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
481 m_allocator = allocator;
◆ set_capacity()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
455 reallocate(newCapacity,
size());
size_type size() const
Definition: vector.hpp:197
◆ size()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
int size_type
Definition: vector.hpp:43
◆ validate_iterator()
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
486 return it >=
begin() && it <=
end();
iterator begin()
Definition: vector.hpp:181
iterator end()
Definition: vector.hpp:189
◆ kInitialCapacity
template<typename T, class TAllocator = std::allocator, class TStorage = standard_vector_storage<T, TAllocator>>
◆ npos
Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei: