Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
iota.hpp
Go to the documentation of this file.
1// Copyright 2026, Toyota Motor Corporation
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5#ifndef INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IOTA_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IOTA_HPP_
7
8// parasoft-begin-suppress CERT_CPP-DCL58-a-2 "Part of a standard library implementation"
9// parasoft-begin-suppress AUTOSAR-A17_6_1-a-2 "Part of a standard library implementation"
10
11// IWYU pragma: private, include <numeric>
12// IWYU pragma: friend "stdlib_detail/.*"
13//
14#include "arene/base/algorithm/detail/traits.hpp"
22
23namespace std {
24
25// parasoft-begin-suppress AUTOSAR-M3_3_2-a "False positive: inline function used in multiple translation units"
26/// @brief fills a range with successive increments of the starting value
27/// @tparam ForwardIt the type of the ForwardIt
28/// @tparam Value the type of the value
29/// @param first ForwardIt to the beginning of the range
30/// @param last ForwardIt to one past the end of the range
31/// @param value initial value to fill with
32///
33/// Fills the range <c> [first, last) </c> with sequentially increasing
34/// values, starting with @c value and repetitively evaluating
35/// <c> ++value </c>.
36///
37/// @pre @c ForwardIt must satisfy the forward iterator requirements
38/// @pre @c T is convertible to the value type of @c ForwardIt
39/// @pre the expression <c> ++value </c> is well-formed
40///
41/// @note Complexity <br>
42/// Exactly <c> distance(first, last) </c> increments and assignments.
43///
44template <
45 class ForwardIt,
46 class Value,
50 decltype(++declval<Value&>())
51 > = nullptr>
52auto iota(ForwardIt first, ForwardIt last, Value value) noexcept( //
54) -> void {
55 arene::base::iota_detail::iota_impl_fn{}(first, last, value);
56}
57// parasoft-end-suppress AUTOSAR-M3_3_2-a
58
59} // namespace std
60
61#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IOTA_HPP_
Public export header for the constraints subpackage.
constexpr bool is_nothrow_invocable_v
Determine if a functor type is no-throw invocable with the specified argument types.
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
STL namespace.
constexpr Type integral_constant< Type, Value >::value
Out-of-line definition for the value constant.
Definition integral_constant.hpp:64
typename enable_if< Condition, Type >::type enable_if_t
Type alias to support constraining templates. Is an alias for the specified type if the Condition is ...
Definition enable_if.hpp:41
auto iota(ForwardIt first, ForwardIt last, Value value) noexcept(//arene::base::is_nothrow_invocable_v< arene::base::iota_detail::iota_impl_fn, ForwardIt &, ForwardIt &, Value & >) -> void
fills a range with successive increments of the starting value
Definition iota.hpp:52
auto declval() noexcept -> T &&
A dummy function that is declared but not defined, with a user-specified return type,...