Commit 0cdff4f2 by Jason Merrill Committed by Jason Merrill

stl_algo.h, [...]: Update to October 28 SGI release.

	* stl_algo.h, stl_algobase.h, stl_bvector.h,
 	stl_deque.h: Update to October 28 SGI release.

From-SVN: r16351
parent 95e8dcba
Thu Nov 6 11:19:09 1997 Jason Merrill <jason@yorick.cygnus.com>
* stl_algo.h, stl_algobase.h, stl_bvector.h,
stl_deque.h: Update to October 28 SGI release.
Sun Nov 2 12:14:56 1997 Jason Merrill <jason@yorick.cygnus.com> Sun Nov 2 12:14:56 1997 Jason Merrill <jason@yorick.cygnus.com>
* algo.h, algobase.h, alloc.h, bvector.h, defalloc.h, deque.h, * algo.h, algobase.h, alloc.h, bvector.h, defalloc.h, deque.h,
......
...@@ -2592,7 +2592,7 @@ bool __is_heap(RandomAccessIterator first, RandomAccessIterator last, ...@@ -2592,7 +2592,7 @@ bool __is_heap(RandomAccessIterator first, RandomAccessIterator last,
for (Distance child = 1; child < n; ++child) { for (Distance child = 1; child < n; ++child) {
if (first[parent] < first[child]) if (first[parent] < first[child])
return false; return false;
if (child & 1 == 0) if ((child & 1) == 0)
++parent; ++parent;
} }
return true; return true;
...@@ -2616,7 +2616,7 @@ bool __is_heap(RandomAccessIterator first, RandomAccessIterator last, ...@@ -2616,7 +2616,7 @@ bool __is_heap(RandomAccessIterator first, RandomAccessIterator last,
for (Distance child = 1; child < n; ++child) { for (Distance child = 1; child < n; ++child) {
if (comp(first[parent], first[child])) if (comp(first[parent], first[child]))
return false; return false;
if (child & 1 == 0) if ((child & 1) == 0)
++parent; ++parent;
} }
return true; return true;
......
...@@ -79,6 +79,9 @@ inline void swap(T& a, T& b) { ...@@ -79,6 +79,9 @@ inline void swap(T& a, T& b) {
#ifndef __BORLANDC__ #ifndef __BORLANDC__
#undef min
#undef max
template <class T> template <class T>
inline const T& min(const T& a, const T& b) { inline const T& min(const T& a, const T& b) {
return b < a ? b : a; return b < a ? b : a;
......
...@@ -565,13 +565,15 @@ public: ...@@ -565,13 +565,15 @@ public:
void insert(iterator pos, long n, bool x) { insert(pos, (size_type)n, x); } void insert(iterator pos, long n, bool x) { insert(pos, (size_type)n, x); }
void pop_back() { --finish; } void pop_back() { --finish; }
void erase(iterator position) { iterator erase(iterator position) {
if (position + 1 != end()) if (position + 1 != end())
copy(position + 1, end(), position); copy(position + 1, end(), position);
--finish; --finish;
return position;
} }
void erase(iterator first, iterator last) { iterator erase(iterator first, iterator last) {
finish = copy(last, end(), first); finish = copy(last, end(), first);
return first;
} }
void resize(size_type new_size, bool x = bool()) { void resize(size_type new_size, bool x = bool()) {
if (new_size < size()) if (new_size < size())
......
...@@ -530,7 +530,7 @@ public: // Erase ...@@ -530,7 +530,7 @@ public: // Erase
iterator next = pos; iterator next = pos;
++next; ++next;
difference_type index = pos - start; difference_type index = pos - start;
if (index < size() >> 1) { if (index < (size() >> 1)) {
copy_backward(start, pos, next); copy_backward(start, pos, next);
pop_front(); pop_front();
} }
......
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