3 #ifndef PARAGRAPH_LIST_H
4 #define PARAGRAPH_LIST_H
6 //#define NO_STD_LIST 1
10 #include "paragraph.h"
14 struct ParagraphList : public std::list<Paragraph>
18 typedef std::pair<ParagraphList::iterator, int> PitPosPair;
33 friend class ParagraphList;
35 typedef std::bidirectional_iterator_tag iterator_category;
37 typedef Paragraph * value_type;
39 typedef ptrdiff_t difference_type;
41 typedef Paragraph * pointer;
43 typedef Paragraph & reference;
47 reference operator*();
51 iterator & operator++();
53 iterator operator++(int);
55 iterator & operator--();
57 iterator operator--(int);
65 class const_iterator {
67 friend class ParagraphList;
69 typedef std::bidirectional_iterator_tag iterator_category;
71 typedef Paragraph * value_type;
73 typedef ptrdiff_t difference_type;
75 typedef Paragraph const * const_pointer;
77 typedef Paragraph const & const_reference;
81 const_reference operator*();
83 const_pointer operator->();
85 const_iterator & operator++();
87 const_iterator operator++(int);
89 const_iterator & operator--();
91 const_iterator operator--(int);
94 const_iterator(value_type);
101 ParagraphList(ParagraphList const &);
103 ParagraphList & operator=(ParagraphList const &);
105 iterator insert(iterator it, Paragraph const & par);
107 void insert(iterator pos, iterator beg, iterator end);
109 void assign(iterator beg, iterator end);
111 void splice(iterator pos, ParagraphList & pl);
115 iterator erase(iterator it);
117 iterator erase(iterator first, iterator last);
121 const_iterator begin() const;
125 const_iterator end() const;
127 void push_back(Paragraph const &);
129 Paragraph const & front() const;
133 Paragraph const & back() const;
147 typedef std::pair<ParagraphList::iterator, int> PitPosPair;
152 bool operator==(ParagraphList::iterator const & i1,
153 ParagraphList::iterator const & i2);
155 bool operator!=(ParagraphList::iterator const & i1,
156 ParagraphList::iterator const & i2);
159 bool operator==(ParagraphList::const_iterator const & i1,
160 ParagraphList::const_iterator const & i2);
162 bool operator!=(ParagraphList::const_iterator const & i1,
163 ParagraphList::const_iterator const & i2);