45 #ifndef BLOCXX_ARRAY_IMPL_HPP_INCLUDE_GUARD_
46 #define BLOCXX_ARRAY_IMPL_HPP_INCLUDE_GUARD_
47 #include "blocxx/BLOCXX_config.h"
50 namespace BLOCXX_NAMESPACE
96 template<
class InputIterator>
102 template <
typename T>
109 template <
typename T>
116 template <
typename T>
123 template <
typename T>
130 template <
typename T>
137 template <
typename T>
144 template <
typename T>
151 template <
typename T>
158 template <
typename T>
165 template <
typename T>
169 return m_impl->max_size();
172 template <
typename T>
176 return m_impl->capacity();
179 template <
typename T>
186 template <
typename T>
190 #ifdef BLOCXX_CHECK_ARRAY_INDEXING
193 return m_impl->operator[](n);
196 template <
typename T>
200 #ifdef BLOCXX_CHECK_ARRAY_INDEXING
203 return m_impl->operator[](n);
206 template <
typename T>
214 template <
typename T>
221 template <
typename T>
228 template <
typename T>
235 template <
typename T>
242 template <
typename T>
249 template <
typename T>
256 template <
typename T>
263 template <
typename T>
270 template <
typename T>
274 return m_impl->insert(position, x);
277 template <
typename T>
284 template <
typename T>
288 #ifdef BLOCXX_CHECK_ARRAY_INDEXING
289 checkValidIndex(index);
294 template <
typename T>
298 #ifdef BLOCXX_CHECK_ARRAY_INDEXING
299 checkValidIndex(begin);
300 checkValidIndex(end - 1);
305 template <
typename T>
306 template<
class InputIterator>
310 m_impl->insert(position, first, last);
313 template <
typename T>
320 template <
typename T>
327 template <
typename T>
331 return m_impl->erase(position);
334 template <
typename T>
338 return m_impl->erase(first, last);
341 template <
typename T>
345 m_impl->resize(new_size, x);
348 template <
typename T>
355 template <
typename T>
362 template <
typename T>
366 for( ; first != end(); ++first)
376 template <
typename T>
380 return find(x, begin(), end());
383 template <
typename T>
387 for( ; first != end(); ++first)
397 template <
typename T>
401 return find(x, begin(), end());
404 template <
typename T>
408 return find(x, first, last) != end();
411 template <
typename T>
415 return find(x, begin(), end()) != end();
418 #ifdef BLOCXX_CHECK_ARRAY_INDEXING
419 BLOCXX_COMMON_API
void throwArrayOutOfBoundsException(
size_t size,
size_t idx);
423 template <
typename T>
429 throwArrayOutOfBoundsException(size(), index);
439 inline bool operator<(const Array<T>& x,
const Array<T>& y)
441 return *x.
m_impl < *y.m_impl;
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.
Array<> wraps std::vector<> in COWReference<> adding ref counting and copy on write capability...
void append(const T &x)
Append an element to the end of the Array.
size_type max_size() const
std::vector< T, std::allocator< T > > V
iterator insert(iterator position, const T &x)
Insert an element in the Array before an element specified by an iterator.
void swap(Array< T > &x, Array< T > &y)
Array()
Default Constructor.
iterator erase(iterator position)
Remove an element of the Array specified with an iterator.
void reserve(size_type n)
Ensure the capacity is at least the size of a given value.
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.
V::const_reverse_iterator const_reverse_iterator
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 appendArray(const Array< T > &x)
Append the elements of another Array to the end of this Array.
bool operator==(const Array< T > &x, const Array< T > &y)
V::reverse_iterator reverse_iterator
size_type capacity() const
void push_back(const T &x)
Append an element to the end of the Array.
reverse_iterator rbegin()
reference operator[](size_type n)
Retrieve A read/write reference to an object in the Array at a given index.
V::const_iterator const_iterator
void pop_back()
Remove the last element of the Array.
void swap(Array< T > &x)
Swap the elements of this Array with the elements of another.
void remove(size_type index)
Remove an element from the Array at a given index.
V::const_reference const_reference
void clear()
Remove all items from the Array.
void swap(IntrusiveReference &rhs)