11#ifndef __BE_MEMORY_AUTOARRAYITERATOR_H__
12#define __BE_MEMORY_AUTOARRAYITERATOR_H__
22 template <
typename T>
class AutoArray;
34 template <
bool C,
class T>
44 std::random_access_iterator_tag;
47 std::conditional<C, const T, T>::type;
52 std::conditional<C, const T*, T*>::type;
55 std::conditional<C, const T&, T&>::type;
82 _autoArray(autoArray),
142 return (_autoArray->operator[](_offset));
150 return (&(_autoArray->operator[](_offset)));
159 return (_autoArray->operator[](rhs));
221 return (_offset - rhs._offset);
277 return (_offset == rhs._offset);
286 return (_offset != rhs._offset);
295 return (_offset > rhs._offset);
304 return (_offset < rhs._offset);
313 return (_offset >= rhs._offset);
322 return (_offset <= rhs._offset);
A C-style array wrapped in the facade of a C++ STL container.
RandomAccessIterator for any AutoArray.
AutoArrayIterator operator--(int)
AutoArrayIterator operator-(const difference_type &rhs) const
std::ptrdiff_t difference_type
Type used to measure distance between iterators.
AutoArrayIterator(container autoArray=nullptr, difference_type offset=0)
Default constructor.
bool operator>=(const AutoArrayIterator &rhs) const
bool operator<(const AutoArrayIterator &rhs) const
typename std::conditional< C, const T *, T * >::type pointer
Pointer to the type iterated over.
bool operator<=(const AutoArrayIterator &rhs) const
bool operator==(const AutoArrayIterator &rhs) const
typename std::conditional< C, const T, T >::type value_type
Type when dereferencing iterators.
AutoArrayIterator & operator=(pointer rhs)
AutoArrayIterator operator++(int)
friend AutoArrayIterator operator+(const difference_type &lhs, const AutoArrayIterator &rhs)
reference operator*() const
AutoArrayIterator(const AutoArrayIterator &rhs)=default
Default copy constructor.
AutoArrayIterator operator+(const difference_type &rhs) const
typename std::conditional< C, const T &, T & >::type reference
Reference to the type iterated over.
AutoArrayIterator & operator=(const AutoArrayIterator &rhs)=default
Default assignment operator.
bool operator!=(const AutoArrayIterator &rhs) const
friend AutoArrayIterator operator-(const difference_type &lhs, const AutoArrayIterator &rhs)
difference_type operator-(const AutoArrayIterator< C, T > &rhs) const
reference operator[](const difference_type &rhs) const
pointer operator->() const
AutoArrayIterator operator+(const AutoArrayIterator &rhs) const
bool operator>(const AutoArrayIterator &rhs) const
std::random_access_iterator_tag iterator_category
Type of iterator.
typename std::conditional< C, const AutoArray< T > *, AutoArray< T > * >::type container
Convenience definition for a reference to the iterated type with appropriate constness.
AutoArrayIterator(AutoArrayIterator &&rhs)=default
Default move constructor.
~AutoArrayIterator()=default
Default destructor.
AutoArrayIterator & operator--()
AutoArrayIterator & operator++()
AutoArrayIterator & operator+=(const difference_type &rhs)
AutoArrayIterator & operator-=(const difference_type &rhs)
This software was developed at the National Institute of Standards and Technology (NIST) by employees...