Commit 5890be18 by Brendan Kehoe Committed by Phil Edwards

re PR libstdc++/3016 (stl_queue.h bugs wrt compliance)

2001-06-04  Brendan Kehoe  <brendan@zen.org>

	PR libstdc++/3016
	* include/bits/stl_queue.h (classes queue, priority_queue):  Fix
	ctors to match the standard.

From-SVN: r42857
parent c0e17daf
2001-06-04 Brendan Kehoe <brendan@zen.org>
PR libstdc++/3016
* include/bits/stl_queue.h (classes queue, priority_queue): Fix
ctors to match the standard.
2001-06-04 Jeffrey Oldham <oldham@codesourcery.com> 2001-06-04 Jeffrey Oldham <oldham@codesourcery.com>
* include/bits/char_traits.h (move): Reverse qualification of * include/bits/char_traits.h (move): Reverse qualification of
......
...@@ -75,8 +75,7 @@ public: ...@@ -75,8 +75,7 @@ public:
protected: protected:
_Sequence c; _Sequence c;
public: public:
queue() : c() {} explicit queue(const _Sequence& __c = _Sequence()) : c(__c) {}
explicit queue(const _Sequence& __c) : c(__c) {}
bool empty() const { return c.empty(); } bool empty() const { return c.empty(); }
size_type size() const { return c.size(); } size_type size() const { return c.size(); }
...@@ -154,25 +153,15 @@ protected: ...@@ -154,25 +153,15 @@ protected:
_Sequence c; _Sequence c;
_Compare comp; _Compare comp;
public: public:
priority_queue() : c() {} explicit priority_queue(const _Compare& __x = _Compare(),
explicit priority_queue(const _Compare& __x) : c(), comp(__x) {} const _Sequence& __s = _Sequence())
priority_queue(const _Compare& __x, const _Sequence& __s)
: c(__s), comp(__x) : c(__s), comp(__x)
{ make_heap(c.begin(), c.end(), comp); } { make_heap(c.begin(), c.end(), comp); }
template <class _InputIterator> template <class _InputIterator>
priority_queue(_InputIterator __first, _InputIterator __last)
: c(__first, __last) { make_heap(c.begin(), c.end(), comp); }
template <class _InputIterator>
priority_queue(_InputIterator __first,
_InputIterator __last, const _Compare& __x)
: c(__first, __last), comp(__x)
{ make_heap(c.begin(), c.end(), comp); }
template <class _InputIterator>
priority_queue(_InputIterator __first, _InputIterator __last, priority_queue(_InputIterator __first, _InputIterator __last,
const _Compare& __x, const _Sequence& __s) const _Compare& __x = _Compare(),
const _Sequence& __s = _Sequence())
: c(__s), comp(__x) : c(__s), comp(__x)
{ {
c.insert(c.end(), __first, __last); c.insert(c.end(), __first, __last);
......
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