2727
2828namespace arrow ::internal {
2929
30+ // / Create a vector containing the values from start with length elements
31+ template <typename T>
32+ std::vector<T> Iota (T start, size_t length) {
33+ std::vector<T> result (length);
34+ std::iota (result.begin (), result.end (), start);
35+ return result;
36+ }
37+
3038// / Create a vector containing the values from start up to stop
3139template <typename T>
3240std::vector<T> Iota (T start, T stop) {
3341 if (start > stop) {
3442 return {};
3543 }
36- std::vector<T> result (static_cast <size_t >(stop - start));
37- std::iota (result.begin (), result.end (), start);
38- return result;
44+ return Iota<T>(start, static_cast <size_t >(stop - start));
3945}
4046
4147// / Create a vector containing the values from 0 up to length
@@ -44,14 +50,6 @@ std::vector<T> Iota(T length) {
4450 return Iota (static_cast <T>(0 ), length);
4551}
4652
47- // / Create a vector containing the values from start with length elements
48- template <typename T>
49- std::vector<T> Iota (T start, size_t length) {
50- std::vector<T> result (length);
51- std::iota (result.begin (), result.end (), start);
52- return result;
53- }
54-
5553// / Create a range from a callable which takes a single index parameter
5654// / and returns the value of iterator on each call and a length.
5755// / Only iterators obtained from the same range should be compared, the
0 commit comments