copy

Copies the contents of one array to another, setting the length of the destination array first.

This function is provided as a shorthand for this common operation.

Template params: T = type of array element

  1. T[] copy(Buffer!(T) dest, T2[] src)
    T[]
    copy
    (
    T
    T2
    )
    (
    ref Buffer!(T) dest
    ,
    T2[] src
    )
  2. T[] copy(T[] dest, T2[] src)

Parameters

dest Buffer!(T)

reference to the destination array

Return Value

Type: T[]

dest

Examples

Buffer!(char) dest;
cstring src = "hello";
copy(dest, src);
test!("==")(dest[], "hello"[]);

Meta