idup

Provide the .idup array property.

  1. immutable(T)[] idup(T[] a)
    @property
    immutable(T)[]
    idup
    (
    T
    )
    (
    T[] a
    )
  2. immutable(T)[] idup(const(T)[] a)

Examples

char[] arr = ['a', 'b', 'c'];
string s = arr.idup;
arr[0] = '.';
assert(s == "abc");
Suggestion Box / Bug Report