diff options
author | pme <pme@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-04 17:34:36 +0000 |
---|---|---|
committer | pme <pme@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-04 17:34:36 +0000 |
commit | 3224e29a40a9229d91d571e4e60e30c8cfdccf34 (patch) | |
tree | 1f8dd89568bc92fcdc5aad0ac109fc590c42ffd3 /libstdc++-v3 | |
parent | 11afc891d97adb19c0b28a67015afb9b9fb1759b (diff) | |
download | gcc-3224e29a40a9229d91d571e4e60e30c8cfdccf34.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42857 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_queue.h | 21 |
2 files changed, 11 insertions, 16 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3688ab3fac9..14ec36e481b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +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> * include/bits/char_traits.h (move): Reverse qualification of diff --git a/libstdc++-v3/include/bits/stl_queue.h b/libstdc++-v3/include/bits/stl_queue.h index ad27ba72db9..c1fe023e4db 100644 --- a/libstdc++-v3/include/bits/stl_queue.h +++ b/libstdc++-v3/include/bits/stl_queue.h @@ -75,8 +75,7 @@ public: protected: _Sequence c; public: - queue() : c() {} - explicit queue(const _Sequence& __c) : c(__c) {} + explicit queue(const _Sequence& __c = _Sequence()) : c(__c) {} bool empty() const { return c.empty(); } size_type size() const { return c.size(); } @@ -154,25 +153,15 @@ protected: _Sequence c; _Compare comp; public: - priority_queue() : c() {} - explicit priority_queue(const _Compare& __x) : c(), comp(__x) {} - priority_queue(const _Compare& __x, const _Sequence& __s) + explicit priority_queue(const _Compare& __x = _Compare(), + const _Sequence& __s = _Sequence()) : c(__s), comp(__x) { make_heap(c.begin(), c.end(), comp); } 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, - const _Compare& __x, const _Sequence& __s) + const _Compare& __x = _Compare(), + const _Sequence& __s = _Sequence()) : c(__s), comp(__x) { c.insert(c.end(), __first, __last); |