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]

[Patch (Newb)]:libstdc++v3/tr1/array: Fix cast in array::end const so that it matches the return type of const_interator.


Problem is that the reinterpret_cast performed by member function
array::end const is a cast to an iterator type. The  return type of
array::end const is of type const_interator. The patch fixes this so
that the cast and the return type match.

Note that I have filed a form with the FSF for the GCC project. I
apologize in advance for any oversights in the patch submission.
Index: array
===================================================================
RCS file: /cvsroot/gcc/gcc/libstdc++-v3/include/tr1/array,v
retrieving revision 1.1
diff -c -3 -p -r1.1 array
*** array	7 Oct 2004 22:06:22 -0000	1.1
--- array	16 Oct 2004 00:22:53 -0000
*************** namespace tr1
*** 82,88 ****
  
        const_iterator 
        end() const
!       { return reinterpret_cast<iterator>(&_M_instance[_S_index - 1]); }
  
        reverse_iterator 
        rbegin()
--- 82,88 ----
  
        const_iterator 
        end() const
!       { return reinterpret_cast<const_iterator>(&_M_instance[_S_index - 1]); }
  
        reverse_iterator 
        rbegin()

Index: ChangeLog
===================================================================
RCS file: /cvsroot/gcc/gcc/libstdc++-v3/ChangeLog,v
retrieving revision 1.2702
diff -c -3 -p -r1.2702 ChangeLog
*** ChangeLog	13 Oct 2004 08:58:37 -0000	1.2702
--- ChangeLog	16 Oct 2004 00:32:50 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2004-10-16 Sashan Govender <sashang@gmail.com>
+ 	* include/tr1/array (array::end const): Fix casting from iterator to
+ 	const_iterator.
+ 
  2004-10-13  Paolo Carlini  <pcarlini@suse.de>
  
  	* include/bits/basic_string.tcc (_S_create): Use consistently


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