Skip to content

Commit 5139cfa

Browse files
committed
fix compilation
1 parent 1b3adaa commit 5139cfa

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

include/ilist.h

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -196,53 +196,48 @@ template <class T, class Tag= void> class sized_ilist : public ilist<T, Tag>
196196
public:
197197
// All containers in C++ should define these types to implement generic
198198
// 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;
210210

211211
sized_ilist() : size_(0) {}
212212

213-
std::size_t size() const { return size_; }
213+
size_type size() const { return size_; }
214214

215215
void clear()
216216
{
217217
BASE::clear();
218218
size_= 0;
219219
}
220220

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)
224222
{
225223
++size_;
226224
return BASE::insert(pos, value);
227225
}
228226

229-
typename ilist<T, Tag>::iterator erase(typename ilist<T, Tag>::iterator pos)
227+
iterator erase(iterator pos)
230228
{
231229
--size_;
232230
return BASE::erase(pos);
233231
}
234232

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); }
237234
void pop_back() { erase(BASE::end()); }
238235

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); }
241237
void pop_front() { erase(BASE::begin()); }
242238

243-
void remove(typename ilist<T, Tag>::reference value)
244-
{ erase(iterator(&value)); }
239+
void remove(reference value) { erase(iterator(&value)); }
245240

246241
private:
247-
size_t size_;
242+
size_type size_;
248243
};

0 commit comments

Comments
 (0)