Template Class CExpandingVector

Class Documentation

template<class T>
class CExpandingVector

A vector that never destructs its elements, but only calls clear on them.

This class is not threadsafe and needs to be protected by locks / mutexes in multithreaded environments.

From the outside / for the user, this class acts as a regular std::vector. However, when calling clear(), a regular vector will destroy the elements which are stored in this vector. This class, will instead call the clear() functions on all members.

Template Parameters:

T – The type of the values. Must provide a .clear() function

Public Types

using value_type = typename std::vector<T>::value_type
using allocator_type = typename std::vector<T>::allocator_type
using size_type = typename std::vector<T>::size_type
using difference_type = typename std::vector<T>::difference_type
using reference = typename std::vector<T>::reference
using const_reference = typename std::vector<T>::const_reference
using pointer = typename std::vector<T>::pointer
using const_pointer = typename std::vector<T>::const_pointer
using iterator = typename std::vector<T>::iterator
using const_iterator = typename std::vector<T>::const_iterator
using reverse_iterator = typename std::vector<T>::reverse_iterator
using const_reverse_iterator = typename std::vector<T>::const_reverse_iterator

Public Functions

inline size_t size() const
inline void clear()
inline void push_back(const T &value)
inline void push_back(T &&value)
inline T &push_back()
inline T &front()
inline const T &front() const
inline T &back()
inline const T &back() const
inline void resize(size_t new_size)
inline T &at(size_t index)
inline const T &at(size_t index) const
inline iterator begin()
inline const_iterator begin() const
inline iterator end()
inline const_iterator end() const
inline size_t capacity() const
inline T &operator[](size_t index)
inline const T &operator[](size_t index) const
inline bool empty() const
inline size_t full_size() const
inline bool operator==(const CExpandingVector<T> &other) const
inline bool operator!=(const CExpandingVector<T> &other) const