45#ifndef BLOCXX_ARRAY_IMPL_HPP_INCLUDE_GUARD_
46#define BLOCXX_ARRAY_IMPL_HPP_INCLUDE_GUARD_
47#include "blocxx/BLOCXX_config.h"
96template<
class InputIterator>
169 return m_impl->max_size();
176 return m_impl->capacity();
190#ifdef BLOCXX_CHECK_ARRAY_INDEXING
193 return m_impl->operator[](n);
200#ifdef BLOCXX_CHECK_ARRAY_INDEXING
203 return m_impl->operator[](n);
274 return m_impl->insert(position, x);
288#ifdef BLOCXX_CHECK_ARRAY_INDEXING
289 checkValidIndex(index);
298#ifdef BLOCXX_CHECK_ARRAY_INDEXING
299 checkValidIndex(begin);
300 checkValidIndex(end - 1);
306template<
class InputIterator>
331 return m_impl->erase(position);
338 return m_impl->erase(first, last);
345 m_impl->resize(new_size, x);
366 for( ; first != end(); ++first)
380 return find(x, begin(), end());
387 for( ; first != end(); ++first)
401 return find(x, begin(), end());
408 return find(x, first, last) != end();
415 return find(x, begin(), end()) != end();
418#ifdef BLOCXX_CHECK_ARRAY_INDEXING
420BLOCXX_COMMON_API
void throwArrayOutOfBoundsException(
size_t size,
size_t idx);
429 throwArrayOutOfBoundsException(size(), index);
Array<> wraps std::vector<> in COWReference<> adding ref counting and copy on write capability.
V::const_iterator const_iterator
void append(const T &x)
Append an element to the end of the Array.
reverse_iterator rbegin()
V::const_reference const_reference
void remove(size_type index)
Remove an element from the Array at a given index.
void push_back(const T &x)
Append an element to the end of the Array.
void appendArray(const Array< T > &x)
Append the elements of another Array to the end of this Array.
iterator erase(iterator position)
Remove an element of the Array specified with an iterator.
size_type max_size() const
bool contains(const T &x, const_iterator first, const_iterator last) const
Determine if element x is contained in the array range specified by the first and last iterators.
void clear()
Remove all items from the Array.
V::const_reverse_iterator const_reverse_iterator
Array()
Default Constructor.
iterator insert(iterator position, const T &x)
Insert an element in the Array before an element specified by an iterator.
void resize(size_type new_size, const T &x)
Ensure the Array is a given size.
Array< T > & operator+=(const T &x)
Append an object to the end of the Array.
void swap(Array< T > &x)
Swap the elements of this Array with the elements of another.
V::reverse_iterator reverse_iterator
std::vector< T, std::allocator< T > > V
void reserve(size_type n)
Ensure the capacity is at least the size of a given value.
const_iterator find(const T &x, const_iterator first, const_iterator last) const
Find element x in the array range specified by the first and last iterators.
size_type capacity() const
reference operator[](size_type n)
Retrieve A read/write reference to an object in the Array at a given index.
void pop_back()
Remove the last element of the Array.
void swap(IntrusiveReference &rhs)
bool operator<(const Array< T > &x, const Array< T > &y)
bool operator==(const Array< T > &x, const Array< T > &y)
void swap(Array< T > &x, Array< T > &y)