On 01/05/2014 05:19 PM, Meta wrote:> The following doesn`t work:
>
> immutable(string[]) strArr = new string[](10);

A pure function is a workaround. The return value of a pure function is implicitly convertible to immutable:

pure string[] foo()
{
    return new string[](10);
}

void main()
{
    immutable(string[]) strArr = foo();
}

Ali

Reply via email to