This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libstdc++/3016: stl_queue.h bugs wrt compliance



>Number:         3016
>Category:       libstdc++
>Synopsis:       stl_queue.h bugs wrt compliance
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 31 14:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     brendan@zen.org
>Release:        egcs3 branch
>Organization:
>Environment:

>Description:
Attached are some tweaks to the definition of queue and priority_queue to make the more compliant with the standard.

Specifically, the constructors in the current stl_queue.h are missing default arguments, and in some cases there are too many versions of the ctors.

Hope this helps,
B
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="diffs-queues.txt"
Content-Disposition: inline; filename="diffs-queues.txt"

2001-05-31  Brendan Kehoe  <brendan@zen.org>

	* include/bits/stl_queue.h (class priority_queue): Fix ctors to
	match the standard.

*** stl_queue.h.~1~	Fri May 25 19:27:04 2001
--- stl_queue.h	Thu May 31 21:28:27 2001
*************** protected:
*** 76,81 ****
    _Sequence c;
  public:
!   queue() : c() {}
!   explicit queue(const _Sequence& __c) : c(__c) {}
  
    bool empty() const { return c.empty(); }
--- 76,80 ----
    _Sequence c;
  public:
!   explicit queue(const _Sequence& __c = _Sequence()) : c(__c) {}
  
    bool empty() const { return c.empty(); }
*************** protected:
*** 155,177 ****
    _Compare comp;
  public:
!   priority_queue() : c() {}
!   explicit priority_queue(const _Compare& __x) :  c(), comp(__x) {}
!   priority_queue(const _Compare& __x, const _Sequence& __s) 
      : 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)
    : c(__s), comp(__x)
    { 
--- 154,166 ----
    _Compare comp;
  public:
!   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,
!                  const _Compare& __x = _Compare(),
! 		 const _Sequence& __s = _Sequence())
    : c(__s), comp(__x)
    { 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]