1 #ifndef OPALS_LIST_HPP_INCLUDED
2 #define OPALS_LIST_HPP_INCLUDED
4 #include <opals/fwd.hpp>
9 struct bidirectional_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 List( size_type n,
const T& val );
78 List& operator=(
const List& other );
79 void swap(
List& other );
100 const_reference front()
const;
101 const_reference back()
const;
106 size_type size()
const;
107 size_type max_size()
const;
110 void resize( size_type n, T val = T() );
115 void push_front(
const T& val );
116 void push_back(
const T& val );
119 void insert(
iterator pos, size_type n,
const T& val );
143 void remove(
const T& val );
149 void merge(
List& from );
164 template<
bool Const,
bool Forward>
170 template<
class T1,
bool Const1>
171 struct ConstSel {
typedef T1 Type; };
173 struct ConstSel<T1,true> {
typedef const T1 Type; };
176 typedef std::bidirectional_iterator_tag iterator_category;
177 typedef T value_type;
178 typedef typename List<T>::difference_type difference_type;
179 typedef typename ConstSel<T,Const>::Type& reference;
180 typedef typename ConstSel<T,Const>::Type* pointer;
188 reference operator* ()
const;
189 pointer operator->()
const;