1 #ifndef OPALS_VECTOR_HPP_INCLUDED
2 #define OPALS_VECTOR_HPP_INCLUDED
4 #include <opals/fwd.hpp>
9 struct random_access_iterator_tag;
51 typedef T
const& const_reference;
52 typedef std::size_t size_type;
53 typedef std::ptrdiff_t difference_type;
55 template<
bool Const,
bool Forward>
67 Vector( size_type n,
const T& val );
80 void swap(
Vector& other );
99 reference operator[]( size_type n );
100 const_reference operator[]( size_type n )
const;
104 const_reference front()
const;
105 const_reference back()
const;
110 size_type size()
const;
111 size_type max_size()
const;
112 size_type capacity()
const;
115 void resize( size_type n, T val = T() );
116 void reserve( size_type n );
121 void push_back(
const T& val );
124 void insert(
iterator pos, size_type n,
const T& val );
148 template<
bool Const,
bool Forward>
154 template<
class T1,
bool Const1>
157 struct ConstSel<T1,true> {
typedef const T1 Type; };
160 typedef std::random_access_iterator_tag iterator_category;
161 typedef T value_type;
162 typedef typename Vector<T>::difference_type difference_type;
163 typedef typename ConstSel<T,Const>::Type& reference;
164 typedef typename ConstSel<T,Const>::Type* pointer;
172 reference operator* ()
const;
173 pointer operator->()
const;
178 Iterator& operator+=( difference_type offset );
179 Iterator operator+ ( difference_type offset )
const;
180 Iterator& operator-=( difference_type offset );
181 Iterator operator- ( difference_type offset )
const;
184 reference operator[]( difference_type offset )
const;
190 bool operator< ( const Iterator<true, Forward>& other )
const;
191 bool operator< ( const Iterator<false,Forward>& other )
const;
194 bool operator<=( const Iterator<true, Forward>& other )
const;
195 bool operator<=( const Iterator<false,Forward>& other )
const;