"Lars T. Kyllingstad" <[email protected]> wrote in message 
news:[email protected]...
> The specific cases in question are templated functions, where I don't
> know whether the array is immutable unless I specifically test it.  I
> simply used arr.idup, assuming the compiler would optimise away the
> duplication when arr is immutable.  But it's no big deal to change it to
>
>   static if (!is(T == immutable)) return arr.idup;
>
> -Lars

Doesn't std.conv.to do this for you? 


Reply via email to