From f6547b681842afcc1096d804f161cb83806178c2 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 2 Nov 2007 15:55:32 +0000 Subject: [PATCH] stl_algo.h (minmax, [...]): Add. 2007-11-02 Paolo Carlini * include/bits/stl_algo.h (minmax, minmax_element): Add. * include/bits/algorithmfwd.h: Update. * testsuite/25_algorithms/minmax/requirements/ explicit_instantiation/2.cc: New. * testsuite/25_algorithms/minmax/requirements/ explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/minmax/1.cc: Likewise. * testsuite/25_algorithms/minmax_element/check_type.cc: Likewise. * testsuite/25_algorithms/minmax_element/requirements/ explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/minmax_element/requirements/ explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/minmax_element/1.cc: Likewise. * testsuite/25_algorithms/headers/algorithm/synopsis.cc: Update. From-SVN: r129853 --- libstdc++-v3/ChangeLog | 17 ++ libstdc++-v3/include/bits/algorithmfwd.h | 23 +++ libstdc++-v3/include/bits/stl_algo.h | 183 ++++++++++++++++++ .../headers/algorithm/synopsis.cc | 18 ++ .../testsuite/25_algorithms/minmax/1.cc | 50 +++++ .../requirements/explicit_instantiation/2.cc | 50 +++++ .../explicit_instantiation/pod.cc | 49 +++++ .../25_algorithms/minmax_element/1.cc | 139 +++++++++++++ .../minmax_element/check_type.cc | 44 +++++ .../requirements/explicit_instantiation/2.cc | 49 +++++ .../explicit_instantiation/pod.cc | 49 +++++ 11 files changed, 671 insertions(+) create mode 100644 libstdc++-v3/testsuite/25_algorithms/minmax/1.cc create mode 100644 libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/2.cc create mode 100644 libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/pod.cc create mode 100644 libstdc++-v3/testsuite/25_algorithms/minmax_element/1.cc create mode 100644 libstdc++-v3/testsuite/25_algorithms/minmax_element/check_type.cc create mode 100644 libstdc++-v3/testsuite/25_algorithms/minmax_element/requirements/explicit_instantiation/2.cc create mode 100644 libstdc++-v3/testsuite/25_algorithms/minmax_element/requirements/explicit_instantiation/pod.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 586f3377953..b477561ca69 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,20 @@ +2007-11-02 Paolo Carlini + + * include/bits/stl_algo.h (minmax, minmax_element): Add. + * include/bits/algorithmfwd.h: Update. + * testsuite/25_algorithms/minmax/requirements/ + explicit_instantiation/2.cc: New. + * testsuite/25_algorithms/minmax/requirements/ + explicit_instantiation/pod.cc: Likewise. + * testsuite/25_algorithms/minmax/1.cc: Likewise. + * testsuite/25_algorithms/minmax_element/check_type.cc: Likewise. + * testsuite/25_algorithms/minmax_element/requirements/ + explicit_instantiation/2.cc: Likewise. + * testsuite/25_algorithms/minmax_element/requirements/ + explicit_instantiation/pod.cc: Likewise. + * testsuite/25_algorithms/minmax_element/1.cc: Likewise. + * testsuite/25_algorithms/headers/algorithm/synopsis.cc: Update. + 2007-11-02 Johannes Singler * include/parallel/workstealing.h: Replaced pragma by function diff --git a/libstdc++-v3/include/bits/algorithmfwd.h b/libstdc++-v3/include/bits/algorithmfwd.h index 9155f83cfbb..2e874040b88 100644 --- a/libstdc++-v3/include/bits/algorithmfwd.h +++ b/libstdc++-v3/include/bits/algorithmfwd.h @@ -45,6 +45,8 @@ inplace_merge is_heap (C++0x) is_heap_until (C++0x) + is_sorted (C++0x) + is_sorted_until (C++0x) iter_swap lexicographical_compare lower_bound @@ -54,6 +56,8 @@ merge min min_element + minmax (C++0x) + minmax_element (C++0x) mismatch next_permutation nth_element @@ -263,6 +267,25 @@ _GLIBCXX_BEGIN_NAMESPACE(std) min(const _Tp&, const _Tp&, _Compare); // min_element + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template + pair + minmax(const _Tp&, const _Tp&); + + template + pair + minmax(const _Tp&, const _Tp&, _Compare); + + template + pair<_FIter, _FIter> + minmax_element(_FIter, _FIter); + + template + pair<_FIter, _FIter> + minmax_element(_FIter, _FIter, _Compare); +#endif + // mismatch template diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index d254ec6dc6e..154e2250b49 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -3745,6 +3745,189 @@ _GLIBCXX_BEGIN_NAMESPACE(std) return __next; return __next; } + + /** + * @brief Determines min and max at once as an ordered pair. + * @param a A thing of arbitrary type. + * @param b Another thing of arbitrary type. + * @return A pair(b, a) if b is smaller than a, pair(a, b) otherwise. + */ + template + inline pair + minmax(const _Tp& __a, const _Tp& __b) + { + // concept requirements + __glibcxx_function_requires(_LessThanComparableConcept<_Tp>) + + return __b < __a ? pair(__b, __a) + : pair(__a, __b); + } + + /** + * @brief Determines min and max at once as an ordered pair. + * @param a A thing of arbitrary type. + * @param b Another thing of arbitrary type. + * @param comp A @link s20_3_3_comparisons comparison functor@endlink. + * @return A pair(b, a) if b is smaller than a, pair(a, b) otherwise. + */ + template + inline pair + minmax(const _Tp& __a, const _Tp& __b, _Compare __comp) + { + return __comp(__b, __a) ? pair(__b, __a) + : pair(__a, __b); + } + + /** + * @brief Return a pair of iterators pointing to the minimum and maximum + * elements in a range. + * @param first Start of range. + * @param last End of range. + * @return make_pair(m, M), where m is the first iterator i in + * [first, last) such that no other element in the range is + * smaller, and where M is the last iterator i in [first, last) + * such that no other element in the range is larger. + */ + template + pair<_ForwardIterator, _ForwardIterator> + minmax_element(_ForwardIterator __first, _ForwardIterator __last) + { + // concept requirements + __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) + __glibcxx_function_requires(_LessThanComparableConcept< + typename iterator_traits<_ForwardIterator>::value_type>) + __glibcxx_requires_valid_range(__first, __last); + + _ForwardIterator __next = __first; + if (__first == __last + || ++__next == __last) + return std::make_pair(__first, __first); + + _ForwardIterator __min, __max; + if (*__next < *__first) + { + __min = __next; + __max = __first; + } + else + { + __min = __first; + __max = __next; + } + + __first = __next; + ++__first; + + while (__first != __last) + { + __next = __first; + if (++__next == __last) + { + if (*__first < *__min) + __min = __first; + else if (!(*__first < *__max)) + __max = __first; + break; + } + + if (*__next < *__first) + { + if (*__next < *__min) + __min = __next; + if (!(*__first < *__max)) + __max = __first; + } + else + { + if (*__first < *__min) + __min = __first; + if (!(*__next < *__max)) + __max = __next; + } + + __first = __next; + ++__first; + } + + return std::make_pair(__min, __max); + } + + /** + * @brief Return a pair of iterators pointing to the minimum and maximum + * elements in a range. + * @param first Start of range. + * @param last End of range. + * @param comp Comparison functor. + * @return make_pair(m, M), where m is the first iterator i in + * [first, last) such that no other element in the range is + * smaller, and where M is the last iterator i in [first, last) + * such that no other element in the range is larger. + */ + template + pair<_ForwardIterator, _ForwardIterator> + minmax_element(_ForwardIterator __first, _ForwardIterator __last, + _Compare __comp) + { + // concept requirements + __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + typename iterator_traits<_ForwardIterator>::value_type, + typename iterator_traits<_ForwardIterator>::value_type>) + __glibcxx_requires_valid_range(__first, __last); + + _ForwardIterator __next = __first; + if (__first == __last + || ++__next == __last) + return std::make_pair(__first, __first); + + _ForwardIterator __min, __max; + if (__comp(*__next, *__first)) + { + __min = __next; + __max = __first; + } + else + { + __min = __first; + __max = __next; + } + + __first = __next; + ++__first; + + while (__first != __last) + { + __next = __first; + if (++__next == __last) + { + if (__comp(*__first, *__min)) + __min = __first; + else if (!__comp(*__first, *__max)) + __max = __first; + break; + } + + if (__comp(*__next, *__first)) + { + if (__comp(*__next, *__min)) + __min = __next; + if (!__comp(*__first, *__max)) + __max = __first; + } + else + { + if (__comp(*__first, *__min)) + __min = __first; + if (!__comp(*__next, *__max)) + __max = __next; + } + + __first = __next; + ++__first; + } + + return std::make_pair(__min, __max); + } #endif // __GXX_EXPERIMENTAL_CXX0X__ _GLIBCXX_END_NAMESPACE diff --git a/libstdc++-v3/testsuite/25_algorithms/headers/algorithm/synopsis.cc b/libstdc++-v3/testsuite/25_algorithms/headers/algorithm/synopsis.cc index 7a02610a320..4939ebf0bd1 100644 --- a/libstdc++-v3/testsuite/25_algorithms/headers/algorithm/synopsis.cc +++ b/libstdc++-v3/testsuite/25_algorithms/headers/algorithm/synopsis.cc @@ -468,6 +468,24 @@ namespace std _FIter max_element(_FIter, _FIter, _Compare); +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template + pair + minmax(const _Tp&, const _Tp&); + + template + pair + minmax(const _Tp&, const _Tp&, _Compare); + + template + pair<_FIter, _FIter> + minmax_element(_FIter, _FIter); + + template + pair<_FIter, _FIter> + minmax_element(_FIter, _FIter, _Compare); +#endif + template bool lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2); diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax/1.cc b/libstdc++-v3/testsuite/25_algorithms/minmax/1.cc new file mode 100644 index 00000000000..480d7f95831 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/minmax/1.cc @@ -0,0 +1,50 @@ +// { dg-options "-std=gnu++0x" } + +// 2007-11-01 Paolo Carlini +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + + std::pair z = std::minmax(1, 2); + std::pair w = std::minmax(4, 3); + VERIFY( z.first == 1 ); + VERIFY( z.second == 2 ); + VERIFY( w.first == 3 ); + VERIFY( w.second == 4 ); + + std::pair zc = std::minmax(1, 2, std::greater()); + std::pair wc = std::minmax(4, 3, std::greater()); + VERIFY( zc.first == 2 ); + VERIFY( zc.second == 1 ); + VERIFY( wc.first == 4 ); + VERIFY( wc.second == 3 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/2.cc new file mode 100644 index 00000000000..17d8e0b0088 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/2.cc @@ -0,0 +1,50 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// 2007-11-01 Paolo Carlini + +// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +#include +#include +#include + +namespace std +{ + using __gnu_test::NonDefaultConstructible; + + typedef NonDefaultConstructible value_type; + typedef value_type* iterator_type; + typedef std::less compare_type; + + template pair + minmax(const value_type&, const value_type&); + template pair + minmax(const value_type&, const value_type&, compare_type); +} + diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/pod.cc new file mode 100644 index 00000000000..887ee47c7c1 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/minmax/requirements/explicit_instantiation/pod.cc @@ -0,0 +1,49 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// 2007-11-01 Paolo Carlini + +// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +#include +#include + +namespace std +{ + using __gnu_test::pod_int; + + typedef pod_int value_type; + typedef value_type* iterator_type; + typedef std::less compare_type; + + template pair + minmax(const value_type&, const value_type&); + template pair + minmax(const value_type&, const value_type&, compare_type); +} + diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax_element/1.cc b/libstdc++-v3/testsuite/25_algorithms/minmax_element/1.cc new file mode 100644 index 00000000000..3ba5e6cf417 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/minmax_element/1.cc @@ -0,0 +1,139 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +#include +#include +#include + +using __gnu_test::test_container; +using __gnu_test::forward_iterator_wrapper; +using std::minmax_element; + +typedef test_container Container; +typedef std::pair, forward_iterator_wrapper > pair_type; + +void +test1() +{ + bool test __attribute__((unused)) = true; + + int array[] = {0}; + Container con(array, array); + pair_type p1 = minmax_element(con.begin(), con.end()); + VERIFY( p1.first.ptr == array ); + VERIFY( p1.second.ptr == array ); +} + +void +test2() +{ + bool test __attribute__((unused)) = true; + + int array[] = {0}; + Container con(array, array + 1); + pair_type p1 = minmax_element(con.begin(), con.end()); + VERIFY( p1.first.ptr == array ); + VERIFY( p1.second.ptr == array ); +} + +void +test3() +{ + bool test __attribute__((unused)) = true; + + int array[] = {0, 3}; + Container con(array, array + 2); + pair_type p1 = minmax_element(con.begin(), con.end()); + VERIFY( p1.first.ptr == array ); + VERIFY( p1.second.ptr == array + 1 ); +} + +void +test4() +{ + bool test __attribute__((unused)) = true; + + int array[] = {3, 0}; + Container con(array, array + 2); + pair_type p1 = minmax_element(con.begin(), con.end()); + VERIFY( p1.first.ptr == array + 1 ); + VERIFY( p1.second.ptr == array ); +} + +void +test5() +{ + bool test __attribute__((unused)) = true; + + int array[] = {3, 3}; + Container con(array, array + 2); + pair_type p1 = minmax_element(con.begin(), con.end()); + VERIFY( p1.first.ptr == array ); + VERIFY( p1.second.ptr == array + 1 ); +} + +void +test6() +{ + bool test __attribute__((unused)) = true; + + int array[] = {6, 3, 0, 2, 6, 4, 0}; + Container con(array, array + 7); + pair_type p1 = minmax_element(con.begin(), con.end()); + VERIFY( p1.first.ptr == array + 2 ); + VERIFY( p1.second.ptr == array + 4 ); +} + +void +test7() +{ + bool test __attribute__((unused)) = true; + + int array[] = {4, 4, 4, 6, 6, 6, 1, 1, 0, 0, 0, 2, 2}; + Container con(array, array + 13); + pair_type p1 = minmax_element(con.begin(), con.end()); + VERIFY( p1.first.ptr == array + 8 ); + VERIFY( p1.second.ptr == array + 5 ); +} + +void +test8() +{ + bool test __attribute__((unused)) = true; + + int array[] = {1, 7, 5, 5, 10, 1, 0, 0, 8, 4, 4, 0, 10, 10, 10, 1}; + Container con(array, array + 16); + pair_type p1 = minmax_element(con.begin(), con.end()); + VERIFY( p1.first.ptr == array + 6 ); + VERIFY( p1.second.ptr == array + 14 ); +} + +int main() +{ + test1(); + test2(); + test3(); + test4(); + test5(); + test6(); + test7(); + test8(); + return 0; +} diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax_element/check_type.cc b/libstdc++-v3/testsuite/25_algorithms/minmax_element/check_type.cc new file mode 100644 index 00000000000..0067f39019f --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/minmax_element/check_type.cc @@ -0,0 +1,44 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// { dg-do compile } + +#include +#include + +using __gnu_test::forward_iterator_wrapper; + +struct S { }; + +bool +operator<(const S&, const S&) {return true;} + +struct X { }; + +bool +predicate(const X&, const X&) {return true;} + +std::pair, forward_iterator_wrapper > +test1(forward_iterator_wrapper& s) +{ return std::minmax_element(s,s); } + +std::pair, forward_iterator_wrapper > +test2(forward_iterator_wrapper& x) +{ return std::minmax_element(x,x,predicate); } diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax_element/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/minmax_element/requirements/explicit_instantiation/2.cc new file mode 100644 index 00000000000..5f50b68cd46 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/minmax_element/requirements/explicit_instantiation/2.cc @@ -0,0 +1,49 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// 2007-11-01 Paolo Carlini + +// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +#include +#include +#include + +namespace std +{ + using __gnu_test::NonDefaultConstructible; + + typedef NonDefaultConstructible value_type; + typedef value_type* iterator_type; + typedef std::less compare_type; + + template pair + minmax_element(iterator_type, iterator_type); + template pair + minmax_element(iterator_type, iterator_type, compare_type); +} diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax_element/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/minmax_element/requirements/explicit_instantiation/pod.cc new file mode 100644 index 00000000000..5ef0cc7482b --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/minmax_element/requirements/explicit_instantiation/pod.cc @@ -0,0 +1,49 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// 2007-11-01 Paolo Carlini + +// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +#include +#include + +namespace std +{ + using __gnu_test::pod_int; + + typedef pod_int value_type; + typedef value_type* iterator_type; + typedef std::less compare_type; + + template pair + minmax_element(iterator_type, iterator_type); + template pair + minmax_element(iterator_type, iterator_type, compare_type); +} +