This is the mail archive of the gcc-patches@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]

[v3] make queue and priority_queue ctors match standard requirements



Tested, approved, and applied; trunk and branch.


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.


Index: include/bits/stl_queue.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_queue.h,v
retrieving revision 1.4
diff -u -3 -p -r1.4 stl_queue.h
--- stl_queue.h	2001/04/13 09:03:18	1.4
+++ stl_queue.h	2001/06/04 17:31:12
@@ -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);


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