diff options
| author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-12 13:59:50 +0000 |
|---|---|---|
| committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-12 13:59:50 +0000 |
| commit | 381ab469096927f9ec73b2b3ca7a92eef7f3330c (patch) | |
| tree | 004de1186fe99700988292c0f35565d4624c8ac3 | |
| parent | d3fcb41730c261894a2241996d3bb8b6a06f9701 (diff) | |
| download | ppe42-gcc-381ab469096927f9ec73b2b3ca7a92eef7f3330c.tar.gz ppe42-gcc-381ab469096927f9ec73b2b3ca7a92eef7f3330c.zip | |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122840 138bc75d-0d04-0410-961f-82ee72b054a4
| -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 73d77bc49cf..8257ba7b5e9 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 9e060b54e48..0496ebf3884 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 5e63feb0052..480557274c2 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 d08aa830ebe..34508dfce61 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 |

