Commit 1b3adaab authored by Marko Mäkelä's avatar Marko Mäkelä

Fix the build with GCC 4.1.2

The build was broken on CentOS 5 and CentOS 6 as a result of
commit 18d8f06f introducing
some constructs that old GCC versions could not cope with.
parent bf1aa756
...@@ -210,7 +210,7 @@ template <class T, class Tag= void> class sized_ilist : public ilist<T, Tag> ...@@ -210,7 +210,7 @@ template <class T, class Tag= void> class sized_ilist : public ilist<T, Tag>
sized_ilist() : size_(0) {} sized_ilist() : size_(0) {}
size_type size() const { return size_; } std::size_t size() const { return size_; }
void clear() void clear()
{ {
...@@ -218,25 +218,30 @@ template <class T, class Tag= void> class sized_ilist : public ilist<T, Tag> ...@@ -218,25 +218,30 @@ template <class T, class Tag= void> class sized_ilist : public ilist<T, Tag>
size_= 0; size_= 0;
} }
iterator insert(iterator pos, reference value) typename ilist<T, Tag>::iterator
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);
} }
iterator erase(iterator pos) typename ilist<T, Tag>::iterator erase(typename ilist<T, Tag>::iterator pos)
{ {
--size_; --size_;
return BASE::erase(pos); return BASE::erase(pos);
} }
void push_back(reference value) { insert(BASE::end(), value); } void push_back(typename ilist<T, Tag>::reference value)
{ insert(BASE::end(), value); }
void pop_back() { erase(BASE::end()); } void pop_back() { erase(BASE::end()); }
void push_front(reference value) { insert(BASE::begin(), value); } void push_front(typename ilist<T, Tag>::reference value)
{ insert(BASE::begin(), value); }
void pop_front() { erase(BASE::begin()); } void pop_front() { erase(BASE::begin()); }
void remove(reference value) { erase(iterator(&value)); } void remove(typename ilist<T, Tag>::reference value)
{ erase(iterator(&value)); }
private: private:
size_t size_; size_t 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