[multiple changes]

2005-07-01  Paolo Carlini  <pcarlini@suse.de>

        Port from libstdcxx_so_7-branch:
	2004-10-28  Chris Jefferson  <chris@bubblescope.net>

	PR libstdc++/17441
	* include/bit/stl_algo.h (find(,,,input_iterator_tag),
	find(,,,random_access_interator_tag),
	find_if(,,,input_iterator_tag),
	find_if(,,,random_access_iterator_tag)): Uglify function name.
	(find, find_if): Use new uglified specialisation names.
	* testsuite/25_algorithms/find/17441.cc: New.

From-SVN: r101501
This commit is contained in:
Paolo Carlini 2005-07-01 08:25:11 +00:00 committed by Paolo Carlini
parent 4f856a3e28
commit c1806f89e0
3 changed files with 68 additions and 12 deletions

View File

@ -1,3 +1,16 @@
2005-07-01 Paolo Carlini <pcarlini@suse.de>
Port from libstdcxx_so_7-branch:
2004-10-28 Chris Jefferson <chris@bubblescope.net>
PR libstdc++/17441
* include/bit/stl_algo.h (find(,,,input_iterator_tag),
find(,,,random_access_interator_tag),
find_if(,,,input_iterator_tag),
find_if(,,,random_access_iterator_tag)): Uglify function name.
(find, find_if): Use new uglified specialisation names.
* testsuite/25_algorithms/find/17441.cc: New.
2005-06-30 Ulrich Weigand <uweigand@de.ibm.com>
* include/ext/pb_assoc/detail/hash_fn/mask_based_range_hashing.hpp

View File

@ -166,7 +166,7 @@ namespace std
*/
template<typename _InputIterator, typename _Tp>
inline _InputIterator
find(_InputIterator __first, _InputIterator __last,
__find(_InputIterator __first, _InputIterator __last,
const _Tp& __val, input_iterator_tag)
{
while (__first != __last && !(*__first == __val))
@ -181,7 +181,7 @@ namespace std
*/
template<typename _InputIterator, typename _Predicate>
inline _InputIterator
find_if(_InputIterator __first, _InputIterator __last,
__find_if(_InputIterator __first, _InputIterator __last,
_Predicate __pred, input_iterator_tag)
{
while (__first != __last && !__pred(*__first))
@ -196,7 +196,7 @@ namespace std
*/
template<typename _RandomAccessIterator, typename _Tp>
_RandomAccessIterator
find(_RandomAccessIterator __first, _RandomAccessIterator __last,
__find(_RandomAccessIterator __first, _RandomAccessIterator __last,
const _Tp& __val, random_access_iterator_tag)
{
typename iterator_traits<_RandomAccessIterator>::difference_type
@ -248,7 +248,7 @@ namespace std
*/
template<typename _RandomAccessIterator, typename _Predicate>
_RandomAccessIterator
find_if(_RandomAccessIterator __first, _RandomAccessIterator __last,
__find_if(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Predicate __pred, random_access_iterator_tag)
{
typename iterator_traits<_RandomAccessIterator>::difference_type
@ -311,7 +311,7 @@ namespace std
__glibcxx_function_requires(_EqualOpConcept<
typename iterator_traits<_InputIterator>::value_type, _Tp>)
__glibcxx_requires_valid_range(__first, __last);
return std::find(__first, __last, __val,
return std::__find(__first, __last, __val,
std::__iterator_category(__first));
}
@ -333,7 +333,7 @@ namespace std
__glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_InputIterator>::value_type>)
__glibcxx_requires_valid_range(__first, __last);
return std::find_if(__first, __last, __pred,
return std::__find_if(__first, __last, __pred,
std::__iterator_category(__first));
}

View File

@ -0,0 +1,43 @@
// Copyright (C) 2004, 2005 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 25.3.1 algorithms, find()
#include <algorithm>
using namespace std;
template<typename InputIterator, typename Tp>
InputIterator
find(InputIterator first, InputIterator last,
const Tp& val, input_iterator_tag)
{ return first; }
// libstdc++/17441
void test01()
{
input_iterator_tag a;
int i;
find(&i, &i, 1, a);
}
int main()
{
test01();
return 0;
}