xxxxxxxxxx
/** Static array helper from p0nce's D idioms
*
* Use with "auto" to get a static array with automatically-deduced
* size. DO NOT assign the return value to a variable of type T[], or
* you will get a dangling pointer.
*/
pure nothrow
T[n] staticArray(T, size_t n)(auto ref T[n] array)
{
return array;
}
enum a = staticArray(["a"]);
extern(C) void main() {
int i = 0;
auto s = a[i];
}