> struct x > { > static: > auto a = iota(1,1000).map!(i => > round(log(i))).take(30).array; > } The solution here to put the array code in to a function that returns it. It's excessive. Why map needs to be hidden inside a function to get it to compile is beyond me.