[cfe-commits] [libcxx] r161309 - /libcxx/trunk/include/__bit_reference

Howard Hinnant hhinnant at apple.com
Sun Aug 5 14:43:11 PDT 2012


Author: hhinnant
Date: Sun Aug  5 16:43:11 2012
New Revision: 161309

URL: http://llvm.org/viewvc/llvm-project?rev=161309&view=rev
Log:
std::equal operating on non-const __bit_iterators was not working.  This fixes it.

Modified:
    libcxx/trunk/include/__bit_reference

Modified: libcxx/trunk/include/__bit_reference
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__bit_reference?rev=161309&r1=161308&r2=161309&view=diff
==============================================================================
--- libcxx/trunk/include/__bit_reference (original)
+++ libcxx/trunk/include/__bit_reference Sun Aug  5 16:43:11 2012
@@ -927,12 +927,12 @@
 
 // equal
 
-template <class _Cp>
+template <class _Cp, bool _IC1, bool _IC2>
 bool
-__equal_unaligned(__bit_iterator<_Cp, true> __first1, __bit_iterator<_Cp, true> __last1,
-                  __bit_iterator<_Cp, true> __first2)
+__equal_unaligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1,
+                  __bit_iterator<_Cp, _IC2> __first2)
 {
-    typedef __bit_iterator<_Cp, true> _It;
+    typedef __bit_iterator<_Cp, _IC1> _It;
     typedef  typename _It::difference_type difference_type;
     typedef typename _It::__storage_type __storage_type;
     static const unsigned __bits_per_word = _It::__bits_per_word;
@@ -1009,12 +1009,12 @@
     return true;
 }
 
-template <class _Cp>
+template <class _Cp, bool _IC1, bool _IC2>
 bool
-__equal_aligned(__bit_iterator<_Cp, true> __first1, __bit_iterator<_Cp, true> __last1,
-                __bit_iterator<_Cp, true> __first2)
+__equal_aligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1,
+                __bit_iterator<_Cp, _IC2> __first2)
 {
-    typedef __bit_iterator<_Cp, true> _It;
+    typedef __bit_iterator<_Cp, _IC1> _It;
     typedef  typename _It::difference_type difference_type;
     typedef typename _It::__storage_type __storage_type;
     static const unsigned __bits_per_word = _It::__bits_per_word;
@@ -1234,12 +1234,12 @@
     template <class _Dp> friend __bit_iterator<_Dp, false> rotate(__bit_iterator<_Dp, false>,
                                                                 __bit_iterator<_Dp, false>,
                                                                 __bit_iterator<_Dp, false>);
-    template <class _Dp> friend bool __equal_aligned(__bit_iterator<_Dp, true>,
-                                                    __bit_iterator<_Dp, true>,
-                                                    __bit_iterator<_Dp, true>);
-    template <class _Dp> friend bool __equal_unaligned(__bit_iterator<_Dp, true>,
-                                                      __bit_iterator<_Dp, true>,
-                                                      __bit_iterator<_Dp, true>);
+    template <class _Dp, bool _IC1, bool _IC2> friend bool __equal_aligned(__bit_iterator<_Dp, _IC1>,
+                                                    __bit_iterator<_Dp, _IC1>,
+                                                    __bit_iterator<_Dp, _IC2>);
+    template <class _Dp, bool _IC1, bool _IC2> friend bool __equal_unaligned(__bit_iterator<_Dp, _IC1>,
+                                                      __bit_iterator<_Dp, _IC1>,
+                                                      __bit_iterator<_Dp, _IC2>);
     template <class _Dp, bool _IC1, bool _IC2> friend bool equal(__bit_iterator<_Dp, _IC1>,
                                                                 __bit_iterator<_Dp, _IC1>,
                                                                 __bit_iterator<_Dp, _IC2>);





More information about the cfe-commits mailing list