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]
Other format: [Raw text]

[v3] Add required cast to sort_heap


Hi,

noticed by the Concepts people. Tested x86-linux, committed to mainline.

Paolo.

/////////////////
2006-09-10  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/stl_heap.h (sort_heap): Iterator post-decrement is
	only required to be convertible to the iterator type.
Index: include/bits/stl_heap.h
===================================================================
--- include/bits/stl_heap.h	(revision 116778)
+++ include/bits/stl_heap.h	(working copy)
@@ -1,6 +1,6 @@
 // Heap implementation -*- C++ -*-
 
-// Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2004, 2005, 2006 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -430,7 +430,7 @@
       //      __glibcxx_requires_heap(__first, __last);
 
       while (__last - __first > 1)
-	std::pop_heap(__first, __last--);
+	std::pop_heap(__first, _RandomAccessIterator(__last--));
     }
 
   /**
@@ -455,7 +455,7 @@
       __glibcxx_requires_heap_pred(__first, __last, __comp);
 
       while (__last - __first > 1)
-	std::pop_heap(__first, __last--, __comp);
+	std::pop_heap(__first, _RandomAccessIterator(__last--), __comp);
     }
 
 _GLIBCXX_END_NAMESPACE

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