Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 D 语言中,从给定范围构造数组的最短方法是什么?
让我有一个迭代器i。如何制作其元素的数组(按顺序)?
i
.array(来自std.array)。
.array
例子:
import std.array : array; import std.range : iota; int[] arr = 10.iota.array;