Go to the documentation of this file.
45 #ifndef BLOCXX_ARRAY_IMPL_HPP_INCLUDE_GUARD_
46 #define BLOCXX_ARRAY_IMPL_HPP_INCLUDE_GUARD_
47 #include "blocxx/BLOCXX_config.h"
61 inline Array<T>::~Array()
66 inline Array<T>::Array(V* toWrap)
72 inline Array<T>::Array(size_type n,
const T& value)
78 inline Array<T>::Array(
int n,
const T& value)
84 inline Array<T>::Array(
long n,
const T& value)
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>
172 template <
typename T>
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
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>
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>
341 template <
typename T>
348 template <
typename T>
355 template <
typename T>
362 template <
typename T>
364 Array<T>::find(
const T &x, const_iterator first, const_iterator last)
const
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);
bool operator<(const Array< T > &x, const Array< T > &y)
void swap(IntrusiveReference &rhs)
V::const_reverse_iterator const_reverse_iterator
V::reverse_iterator 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 remove(size_type index)
Remove an element from the Array at a given index.
void appendArray(const Array< T > &x)
Append the elements of another Array to the end of this Array.
size_type max_size() const
Array< T > & operator+=(const T &x)
Append an object to the end of the Array.
reverse_iterator rbegin()
V::const_iterator const_iterator
void swap(Array< T > &x, Array< T > &y)
void swap(Array< T > &x)
Swap the elements of this Array with the elements of another.
std::vector< T, std::allocator< T > > V
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.
void pop_back()
Remove the last element of the Array.
void append(const T &x)
Append an element to the end of the Array.
void resize(size_type new_size, const T &x)
Ensure the Array is a given size.
reference operator[](size_type n)
Retrieve A read/write reference to an object in the Array at a given index.
void clear()
Remove all items from the Array.
bool operator==(const Array< T > &x, const Array< T > &y)
V::const_reference const_reference
iterator erase(iterator position)
Remove an element of the Array specified with an iterator.
iterator insert(iterator position, const T &x)
Insert an element in the Array before an element specified by an iterator.
size_type capacity() const
void reserve(size_type n)
Ensure the capacity is at least the size of a given value.
Array()
Default Constructor.
void push_back(const T &x)
Append an element to the end of the Array.
Array<> wraps std::vector<> in COWReference<> adding ref counting and copy on write capability.