Commit 5139cfab authored by Eugene Kosov's avatar Eugene Kosov

fix compilation

parent 1b3adaab
...@@ -196,21 +196,21 @@ template <class T, class Tag= void> class sized_ilist : public ilist<T, Tag> ...@@ -196,21 +196,21 @@ template <class T, class Tag= void> class sized_ilist : public ilist<T, Tag>
public: public:
// All containers in C++ should define these types to implement generic // All containers in C++ should define these types to implement generic
// container interface. // container interface.
using typename BASE::const_iterator; typedef T value_type;
using typename BASE::const_pointer; typedef std::size_t size_type;
using typename BASE::const_reference; typedef std::ptrdiff_t difference_type;
using typename BASE::const_reverse_iterator; typedef value_type &reference;
using typename BASE::difference_type; typedef const value_type &const_reference;
using typename BASE::iterator; typedef T *pointer;
using typename BASE::pointer; typedef const T *const_pointer;
using typename BASE::reference; typedef typename BASE::Iterator iterator;
using typename BASE::reverse_iterator; typedef const typename BASE::Iterator const_iterator;
using typename BASE::size_type; typedef std::reverse_iterator<iterator> reverse_iterator;
using typename BASE::value_type; typedef std::reverse_iterator<const iterator> const_reverse_iterator;
sized_ilist() : size_(0) {} sized_ilist() : size_(0) {}
std::size_t size() const { return size_; } size_type size() const { return size_; }
void clear() void clear()
{ {
...@@ -218,31 +218,26 @@ template <class T, class Tag= void> class sized_ilist : public ilist<T, Tag> ...@@ -218,31 +218,26 @@ template <class T, class Tag= void> class sized_ilist : public ilist<T, Tag>
size_= 0; size_= 0;
} }
typename ilist<T, Tag>::iterator iterator insert(iterator pos, reference value)
insert(typename ilist<T, Tag>::iterator pos,
typename ilist<T, Tag>::reference value)
{ {
++size_; ++size_;
return BASE::insert(pos, value); return BASE::insert(pos, value);
} }
typename ilist<T, Tag>::iterator erase(typename ilist<T, Tag>::iterator pos) iterator erase(iterator pos)
{ {
--size_; --size_;
return BASE::erase(pos); return BASE::erase(pos);
} }
void push_back(typename ilist<T, Tag>::reference value) void push_back(reference value) { insert(BASE::end(), value); }
{ insert(BASE::end(), value); }
void pop_back() { erase(BASE::end()); } void pop_back() { erase(BASE::end()); }
void push_front(typename ilist<T, Tag>::reference value) void push_front(reference value) { insert(BASE::begin(), value); }
{ insert(BASE::begin(), value); }
void pop_front() { erase(BASE::begin()); } void pop_front() { erase(BASE::begin()); }
void remove(typename ilist<T, Tag>::reference value) void remove(reference value) { erase(iterator(&value)); }
{ erase(iterator(&value)); }
private: private:
size_t size_; size_type size_;
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment