@@ -196,53 +196,48 @@ template <class T, class Tag= void> class sized_ilist : public ilist<T, Tag>
196
196
public:
197
197
// All containers in C++ should define these types to implement generic
198
198
// container interface.
199
- using typename BASE::const_iterator ;
200
- using typename BASE::const_pointer ;
201
- using typename BASE::const_reference ;
202
- using typename BASE::const_reverse_iterator ;
203
- using typename BASE::difference_type ;
204
- using typename BASE::iterator ;
205
- using typename BASE::pointer ;
206
- using typename BASE::reference ;
207
- using typename BASE::reverse_iterator ;
208
- using typename BASE::size_type ;
209
- using typename BASE::value_type ;
199
+ typedef T value_type ;
200
+ typedef std:: size_t size_type ;
201
+ typedef std:: ptrdiff_t difference_type ;
202
+ typedef value_type &reference ;
203
+ typedef const value_type &const_reference ;
204
+ typedef T *pointer ;
205
+ typedef const T *const_pointer ;
206
+ typedef typename BASE::Iterator iterator ;
207
+ typedef const typename BASE::Iterator const_iterator ;
208
+ typedef std::reverse_iterator<iterator> reverse_iterator ;
209
+ typedef std::reverse_iterator< const iterator> const_reverse_iterator ;
210
210
211
211
sized_ilist () : size_(0 ) {}
212
212
213
- std:: size_t size () const { return size_; }
213
+ size_type size () const { return size_; }
214
214
215
215
void clear ()
216
216
{
217
217
BASE::clear ();
218
218
size_= 0 ;
219
219
}
220
220
221
- typename ilist<T, Tag>::iterator
222
- insert (typename ilist<T, Tag>::iterator pos,
223
- typename ilist<T, Tag>::reference value)
221
+ iterator insert (iterator pos, reference value)
224
222
{
225
223
++size_;
226
224
return BASE::insert (pos, value);
227
225
}
228
226
229
- typename ilist<T, Tag>:: iterator erase (typename ilist<T, Tag>:: iterator pos)
227
+ iterator erase (iterator pos)
230
228
{
231
229
--size_;
232
230
return BASE::erase (pos);
233
231
}
234
232
235
- void push_back (typename ilist<T, Tag>::reference value)
236
- { insert (BASE::end (), value); }
233
+ void push_back (reference value) { insert (BASE::end (), value); }
237
234
void pop_back () { erase (BASE::end ()); }
238
235
239
- void push_front (typename ilist<T, Tag>::reference value)
240
- { insert (BASE::begin (), value); }
236
+ void push_front (reference value) { insert (BASE::begin (), value); }
241
237
void pop_front () { erase (BASE::begin ()); }
242
238
243
- void remove (typename ilist<T, Tag>::reference value)
244
- { erase (iterator (&value)); }
239
+ void remove (reference value) { erase (iterator (&value)); }
245
240
246
241
private:
247
- size_t size_;
242
+ size_type size_;
248
243
};
0 commit comments