[numeric.iota]
llvm-svn: 104719
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 40c7ef90b21d52e0f0c303ddca6a757f9829781f
diff --git a/include/numeric b/include/numeric
index 14a6615..8c0bc4d 100644
--- a/include/numeric
+++ b/include/numeric
@@ -50,6 +50,9 @@
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 @@
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