+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
*/
template<typename _InputIterator, typename _Tp>
inline _InputIterator
- find(_InputIterator __first, _InputIterator __last,
- const _Tp& __val, input_iterator_tag)
+ __find(_InputIterator __first, _InputIterator __last,
+ const _Tp& __val, input_iterator_tag)
{
while (__first != __last && !(*__first == __val))
++__first;
*/
template<typename _InputIterator, typename _Predicate>
inline _InputIterator
- find_if(_InputIterator __first, _InputIterator __last,
- _Predicate __pred, input_iterator_tag)
+ __find_if(_InputIterator __first, _InputIterator __last,
+ _Predicate __pred, input_iterator_tag)
{
while (__first != __last && !__pred(*__first))
++__first;
*/
template<typename _RandomAccessIterator, typename _Tp>
_RandomAccessIterator
- find(_RandomAccessIterator __first, _RandomAccessIterator __last,
- const _Tp& __val, random_access_iterator_tag)
+ __find(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ const _Tp& __val, random_access_iterator_tag)
{
typename iterator_traits<_RandomAccessIterator>::difference_type
__trip_count = (__last - __first) >> 2;
*/
template<typename _RandomAccessIterator, typename _Predicate>
_RandomAccessIterator
- find_if(_RandomAccessIterator __first, _RandomAccessIterator __last,
- _Predicate __pred, random_access_iterator_tag)
+ __find_if(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _Predicate __pred, random_access_iterator_tag)
{
typename iterator_traits<_RandomAccessIterator>::difference_type
__trip_count = (__last - __first) >> 2;
__glibcxx_function_requires(_EqualOpConcept<
typename iterator_traits<_InputIterator>::value_type, _Tp>)
__glibcxx_requires_valid_range(__first, __last);
- return std::find(__first, __last, __val,
- std::__iterator_category(__first));
+ return std::__find(__first, __last, __val,
+ std::__iterator_category(__first));
}
/**
__glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_InputIterator>::value_type>)
__glibcxx_requires_valid_range(__first, __last);
- return std::find_if(__first, __last, __pred,
- std::__iterator_category(__first));
+ return std::__find_if(__first, __last, __pred,
+ std::__iterator_category(__first));
}
/**
--- /dev/null
+// 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;
+}