Distributed Ranges
Loading...
Searching...
No Matches
iota.hpp
1// SPDX-FileCopyrightText: Intel Corporation
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#pragma once
6
7namespace dr::views {
8
9//
10// range-v3 iota uses sentinels that are not the same type as the
11// iterator. A zip that uses an iota has the same issue. Make our own.
12//
13
14struct iota_fn_ {
15 template <std::integral W> auto operator()(W value) const {
16 return rng::views::iota(value, std::numeric_limits<W>::max());
17 }
18
19 template <std::integral W, std::integral Bound>
20 auto operator()(W value, Bound bound) const {
21 return rng::views::iota(value, W(bound));
22 }
23};
24
25inline constexpr auto iota = iota_fn_{};
26
27} // namespace dr::views
Definition: iota.hpp:14