diff options
author | Howard Hinnant <hhinnant@apple.com> | 2010-05-26 18:53:44 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2010-05-26 18:53:44 +0000 |
commit | 40c7ef90b21d52e0f0c303ddca6a757f9829781f (patch) | |
tree | 9c95e6dab1bd1dd19cd8ba32cfcf463f678d0ce6 /libcxx/include | |
parent | 52c27383241147457f9da0e24e1c7f39b51d80db (diff) | |
download | bcm5719-llvm-40c7ef90b21d52e0f0c303ddca6a757f9829781f.tar.gz bcm5719-llvm-40c7ef90b21d52e0f0c303ddca6a757f9829781f.zip |
[numeric.iota]
llvm-svn: 104719
Diffstat (limited to 'libcxx/include')
-rw-r--r-- | libcxx/include/numeric | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libcxx/include/numeric b/libcxx/include/numeric index 14a6615d14c..8c0bc4d3719 100644 --- a/libcxx/include/numeric +++ b/libcxx/include/numeric @@ -50,6 +50,9 @@ template <class InputIterator, class OutputIterator, class BinaryOperation> OutputIterator adjacent_difference(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op); +template <class ForwardIterator, class T> + void iota(ForwardIterator first, ForwardIterator last, T value); + } // std */ @@ -178,6 +181,15 @@ adjacent_difference(_InputIterator __first, _InputIterator __last, _OutputIterat return __result; } +template <class _ForwardIterator, class _Tp> +inline _LIBCPP_INLINE_VISIBILITY +void +iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value) +{ + for (; __first != __last; ++__first, ++__value) + *__first = __value; +} + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_NUMERIC |