aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Wojak <emil@wojak.eu>2011-10-11 12:39:18 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2011-10-11 12:39:18 +0000
commit92b2342a6e84625b6b760ba3b295082c724acd63 (patch)
treec92a76c146cd804e422a2c4b359a4501adda8fa8
parent45ce6084c2547d75f1cf5e1d8d12305aa85e02d8 (diff)
downloadgcc-92b2342a6e84625b6b760ba3b295082c724acd63.zip
gcc-92b2342a6e84625b6b760ba3b295082c724acd63.tar.gz
gcc-92b2342a6e84625b6b760ba3b295082c724acd63.tar.bz2
re PR libstdc++/50661 (std::equal should use more efficient version for arrays of pointers)
2011-10-11 Emil Wojak <emil@wojak.eu> PR c++/50661 * include/bits/stl_algobase.h (equal): Compare arrays of pointers too with memcmp. From-SVN: r179801
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h3
2 files changed, 9 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 1822ff6..628e213 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,9 @@
+2011-10-11 Emil Wojak <emil@wojak.eu>
+
+ PR c++/50661
+ * include/bits/stl_algobase.h (equal): Compare arrays of pointers
+ too with memcmp.
+
2011-10-10 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/49818
@@ -11,7 +17,7 @@
* libsupc++/eh_catch.cc: Same.
* libsupc++/eh_globals.cc: Same.
* libsupc++/eh_type.cc: Same.
-
+
2011-10-07 Jonathan Wakely <jwakely.gcc@gmail.com>
* testsuite/util/testsuite_allocator.h (uneq_allocator): Add
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index 9d3a970..a002461 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -812,7 +812,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
typedef typename iterator_traits<_II1>::value_type _ValueType1;
typedef typename iterator_traits<_II2>::value_type _ValueType2;
- const bool __simple = (__is_integer<_ValueType1>::__value
+ const bool __simple = ((__is_integer<_ValueType1>::__value
+ || __is_pointer<_ValueType1>::__value)
&& __is_pointer<_II1>::__value
&& __is_pointer<_II2>::__value
&& __are_same<_ValueType1, _ValueType2>::__value);