How to convert a chunks result to a two-dimensional array

H. S. Teoh hsteoh at quickfur.ath.cx
Sat Jan 15 03:30:56 UTC 2022


On Sat, Jan 15, 2022 at 01:49:14AM +0000, forkit via Digitalmars-d-learn wrote:
[...]
>     int[][] arrayOfarrays = iota(1, 16).chunks(5).to2Darray; // how to
> convert this into [][]
[...]

	auto arrayOfArrays = iota(1, 16).chunks(5).map!(r => r.array).array;


T

-- 
Winners never quit, quitters never win. But those who never quit AND never win are idiots.


More information about the Digitalmars-d-learn mailing list