diff options
author | Paolo Carlini <pcarlini@suse.de> | 2007-03-12 13:59:50 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2007-03-12 13:59:50 +0000 |
commit | 91b0b94a042721a2a8dff04f0a177a37c4f08cad (patch) | |
tree | 004de1186fe99700988292c0f35565d4624c8ac3 | |
parent | d8e3118a8bc045790675c3dceb01ac1e1905e658 (diff) | |
download | gcc-91b0b94a042721a2a8dff04f0a177a37c4f08cad.zip gcc-91b0b94a042721a2a8dff04f0a177a37c4f08cad.tar.gz gcc-91b0b94a042721a2a8dff04f0a177a37c4f08cad.tar.bz2 |
stl_algo.h (swap_ranges): Move...
2007-03-12 Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_algo.h (swap_ranges): Move...
* include/bits/stl_algobase.h: ... here.
* include/tr1/array: Trim includes, stl_algobase.h is enough.
From-SVN: r122840
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_algo.h | 34 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_algobase.h | 34 | ||||
-rw-r--r-- | libstdc++-v3/include/tr1/array | 9 |
4 files changed, 42 insertions, 41 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 73d77bc..8257ba7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2007-03-12 Paolo Carlini <pcarlini@suse.de> + + * include/bits/stl_algo.h (swap_ranges): Move... + * include/bits/stl_algobase.h: ... here. + * include/tr1/array: Trim includes, stl_algobase.h is enough. + 2007-03-11 Paolo Carlini <pcarlini@suse.de> PR libstdc++/28080 (final) diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index 9e060b54e..0496ebf 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -861,40 +861,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } /** - * @brief Swap the elements of two sequences. - * @param first1 A forward iterator. - * @param last1 A forward iterator. - * @param first2 A forward iterator. - * @return An iterator equal to @p first2+(last1-first1). - * - * Swaps each element in the range @p [first1,last1) with the - * corresponding element in the range @p [first2,(last1-first1)). - * The ranges must not overlap. - */ - template<typename _ForwardIterator1, typename _ForwardIterator2> - _ForwardIterator2 - swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, - _ForwardIterator2 __first2) - { - // concept requirements - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator1>) - __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< - _ForwardIterator2>) - __glibcxx_function_requires(_ConvertibleConcept< - typename iterator_traits<_ForwardIterator1>::value_type, - typename iterator_traits<_ForwardIterator2>::value_type>) - __glibcxx_function_requires(_ConvertibleConcept< - typename iterator_traits<_ForwardIterator2>::value_type, - typename iterator_traits<_ForwardIterator1>::value_type>) - __glibcxx_requires_valid_range(__first1, __last1); - - for ( ; __first1 != __last1; ++__first1, ++__first2) - std::iter_swap(__first1, __first2); - return __first2; - } - - /** * @brief Perform an operation on a sequence. * @param first An input iterator. * @param last An input iterator. diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index 5e63feb..4805572 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -168,6 +168,40 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } /** + * @brief Swap the elements of two sequences. + * @param first1 A forward iterator. + * @param last1 A forward iterator. + * @param first2 A forward iterator. + * @return An iterator equal to @p first2+(last1-first1). + * + * Swaps each element in the range @p [first1,last1) with the + * corresponding element in the range @p [first2,(last1-first1)). + * The ranges must not overlap. + */ + template<typename _ForwardIterator1, typename _ForwardIterator2> + _ForwardIterator2 + swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, + _ForwardIterator2 __first2) + { + // concept requirements + __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< + _ForwardIterator1>) + __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< + _ForwardIterator2>) + __glibcxx_function_requires(_ConvertibleConcept< + typename iterator_traits<_ForwardIterator1>::value_type, + typename iterator_traits<_ForwardIterator2>::value_type>) + __glibcxx_function_requires(_ConvertibleConcept< + typename iterator_traits<_ForwardIterator2>::value_type, + typename iterator_traits<_ForwardIterator1>::value_type>) + __glibcxx_requires_valid_range(__first1, __last1); + + for (; __first1 != __last1; ++__first1, ++__first2) + std::iter_swap(__first1, __first2); + return __first2; + } + + /** * @brief This does what you think it does. * @param a A thing of arbitrary type. * @param b Another thing of arbitrary type. diff --git a/libstdc++-v3/include/tr1/array b/libstdc++-v3/include/tr1/array index d08aa83..34508df 100644 --- a/libstdc++-v3/include/tr1/array +++ b/libstdc++-v3/include/tr1/array @@ -1,6 +1,6 @@ // class template array -*- C++ -*- -// Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005, 2006, 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 @@ -34,12 +34,7 @@ #ifndef _TR1_ARRAY #define _TR1_ARRAY 1 -#include <new> -#include <iterator> -#include <algorithm> -#include <cstddef> -#include <bits/functexcept.h> -#include <ext/type_traits.h> +#include <bits/stl_algobase.h> //namespace std::tr1 namespace std |