On 09/09/2012 06:37 PM, Piotr Szturmaj wrote:
Timon Gehr wrote:
-1 for removing .idup, it is handy.

auto idup(E)(const(E)[] arr) pure @trusted
{
     immutable result = arr.dup();
     return result;
}


auto idup(E)(const(E)[] arr) pure nothrow @safe
if(is(typeof({immutable r=arr.dup;}))){
    return cast()cast(immutable)arr.dup;
}

:-)


Reply via email to