D-Programming-Language/phobos — pull request #1305 by dymk (2013-05-25 20:09:06+00:00)
Title: fix for calling .array() on ranges in CTFE

Previously .array() could not be called on ranges in CTFE mode as it relied on calling malloc(), so code such as this would not work:

```d
void main() {
const a = [1, 2, 3];
const b = a.map!("a + 1").array();
pragma(msg, b);
}
```

This provides a fix so memory will be allocated with new() instead of malloc() if the compiler is in CTFE mode.