We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e54288b + 5294809 commit ddf5567Copy full SHA for ddf5567
1 file changed
std/array.d
@@ -318,7 +318,9 @@ if(allSatisfy!(isIntegral, I))
318
319
alias typeof(T.init[0]) E;
320
321
- auto ptr = cast(E*) GC.malloc(sizes[0] * E.sizeof, blockAttribute!(E));
+ auto ptr = (__ctfe) ?
322
+ (new E[](sizes[0])).ptr :
323
+ cast(E*) GC.malloc(sizes[0] * E.sizeof, blockAttribute!(E));
324
auto ret = ptr[0..sizes[0]];
325
326
static if(sizes.length > 1)
0 commit comments