From 92b2342a6e84625b6b760ba3b295082c724acd63 Mon Sep 17 00:00:00 2001 From: Emil Wojak Date: Tue, 11 Oct 2011 12:39:18 +0000 Subject: [PATCH] re PR libstdc++/50661 (std::equal should use more efficient version for arrays of pointers) 2011-10-11 Emil Wojak PR c++/50661 * include/bits/stl_algobase.h (equal): Compare arrays of pointers too with memcmp. From-SVN: r179801 --- libstdc++-v3/ChangeLog | 8 +++++++- libstdc++-v3/include/bits/stl_algobase.h | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 1822ff610e78..628e213f1fc8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2011-10-11 Emil Wojak + + PR c++/50661 + * include/bits/stl_algobase.h (equal): Compare arrays of pointers + too with memcmp. + 2011-10-10 Benjamin Kosnik 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 * 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 9d3a970d2cae..a002461ae980 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);