diff options
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/bits/stl_numeric.h | 41 | ||||
-rw-r--r-- | libstdc++-v3/include/ext/algorithm | 7 |
2 files changed, 40 insertions, 8 deletions
diff --git a/libstdc++-v3/include/bits/stl_numeric.h b/libstdc++-v3/include/bits/stl_numeric.h index 3940e4aa970..c86122679da 100644 --- a/libstdc++-v3/include/bits/stl_numeric.h +++ b/libstdc++-v3/include/bits/stl_numeric.h @@ -1,6 +1,6 @@ // Numeric functions implementation -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -65,6 +65,43 @@ #include <bits/concept_check.h> #include <debug/debug.h> +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + +_GLIBCXX_BEGIN_NAMESPACE(std) + + /** + * @brief Create a range of sequentially increasing values. + * + * For each element in the range @p [first,last) assigns @p value and + * increments @p value as if by @p ++value. + * + * @param first Start of range. + * @param last End of range. + * @param value Starting value. + * @return Nothing. + */ + template<typename _ForwardIterator, typename _Tp> + void + iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value) + { + // concept requirements + __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< + _ForwardIterator>) + __glibcxx_function_requires(_ConvertibleConcept<_Tp, + typename iterator_traits<_ForwardIterator>::value_type>) + __glibcxx_requires_valid_range(__first, __last); + + for (; __first != __last; ++__first) + { + *__first = __value; + ++__value; + } + } + +_GLIBCXX_END_NAMESPACE + +#endif + _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P) /** @@ -164,7 +201,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P) * @return The final inner product. */ template<typename _InputIterator1, typename _InputIterator2, typename _Tp, - typename _BinaryOperation1, typename _BinaryOperation2> + typename _BinaryOperation1, typename _BinaryOperation2> inline _Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init, diff --git a/libstdc++-v3/include/ext/algorithm b/libstdc++-v3/include/ext/algorithm index 5a24b7e6f48..2af2cb1cb36 100644 --- a/libstdc++-v3/include/ext/algorithm +++ b/libstdc++-v3/include/ext/algorithm @@ -1,6 +1,6 @@ // Algorithm extensions -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -428,10 +428,6 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) __out_last - __out_first); } -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - using std::is_heap; - using std::is_sorted; -#else /** * This is an SGI extension. * @ingroup SGIextensions @@ -527,7 +523,6 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) return false; return true; } -#endif _GLIBCXX_END_NAMESPACE |