xref: /llvm-project/libcxx/include/__numeric/iota.h (revision 9783f28cbb155e4a8d49c12e1c60ce14dcfaf0c7)
1a0efb175SChristopher Di Bella // -*- C++ -*-
2a0efb175SChristopher Di Bella //===----------------------------------------------------------------------===//
3a0efb175SChristopher Di Bella //
4a0efb175SChristopher Di Bella // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5a0efb175SChristopher Di Bella // See https://llvm.org/LICENSE.txt for license information.
6a0efb175SChristopher Di Bella // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7a0efb175SChristopher Di Bella //
8a0efb175SChristopher Di Bella //===----------------------------------------------------------------------===//
9a0efb175SChristopher Di Bella 
10a0efb175SChristopher Di Bella #ifndef _LIBCPP___NUMERIC_IOTA_H
11a0efb175SChristopher Di Bella #define _LIBCPP___NUMERIC_IOTA_H
12a0efb175SChristopher Di Bella 
13a0efb175SChristopher Di Bella #include <__config>
14a0efb175SChristopher Di Bella 
15a0efb175SChristopher Di Bella #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16a0efb175SChristopher Di Bella #  pragma GCC system_header
17a0efb175SChristopher Di Bella #endif
18a0efb175SChristopher Di Bella 
19a0efb175SChristopher Di Bella _LIBCPP_BEGIN_NAMESPACE_STD
20a0efb175SChristopher Di Bella 
21a0efb175SChristopher Di Bella template <class _ForwardIterator, class _Tp>
22*9783f28cSLouis Dionne _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
iota(_ForwardIterator __first,_ForwardIterator __last,_Tp __value)23*9783f28cSLouis Dionne iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value) {
24b48c5010SNikolas Klauser   for (; __first != __last; ++__first, (void)++__value)
25b48c5010SNikolas Klauser     *__first = __value;
26a0efb175SChristopher Di Bella }
27a0efb175SChristopher Di Bella 
28a0efb175SChristopher Di Bella _LIBCPP_END_NAMESPACE_STD
29a0efb175SChristopher Di Bella 
30a0efb175SChristopher Di Bella #endif // _LIBCPP___NUMERIC_IOTA_H
31