54 template<
class C,
class I>
103 m_chunks.back()->data.push_back(std::move(t));
107 template<
class...Args>
111 m_chunks.back()->data.emplace_back(std::forward<Args>(args)...);
118 if (
m_chunks.back()->data.size()==0)
151 m_chunks.push_back(std::make_unique<Chunk>());
std::bidirectional_iterator_tag iterator_category
friend bool operator!=(const Iterator &a, const Iterator &b)
std::ptrdiff_t difference_type
Iterator(C &vec, size_t pos)
friend bool operator==(const Iterator &a, const Iterator &b)
std::vector like container optimized for pushing elements to the back.
const T & at(size_t i) const
access specified element
void clear()
clears the contents
void push_back(T &&t)
adds an element to the end
size_t size() const
returns the number of elements
iterator end()
returns an iterator to the end
T & back()
access the last element
const T & front() const
access the first element
Iterator< const GrowVector, const T > const_iterator
static const size_t chunkSize
void pop_back()
removes the last element
bool empty() const
checks whether the container is empty
T & at(size_t i)
access specified element
const T & back() const
access the last element
void emplace_back(Args &&...args)
constructs an element in-place at the end
Iterator< GrowVector, T > iterator
const_iterator end() const
returns an iterator to the end
std::vector< ChunkPtr > m_chunks
static const size_t chunkBits
iterator begin()
returns an iterator to the beginning
static const size_t chunkMask
const_iterator begin() const
returns an iterator to the beginning
T & front()
access the first element
std::unique_ptr< Chunk > ChunkPtr
#define DEFAULT_COPYABLE(cls)
Macro to help implementing the rule of 5 for a default copyable & movable class.