copyExtend

Copies the contents of src to dest, increasing dest.length if required. Since dest.length will not be decreased, dest will contain tailing garbage if src.length < dest.length.

Template params: T = type of array element

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

Parameters

dest Buffer!(T)

reference to the destination array

Return Value

Type: T[]

slice to copied elements in dest

Examples

auto dst = createBuffer("aa");
copyExtend(dst, "bbbb");
test!("==")(dst[], "bbbb");
copyExtend(dst, "ccc");
test!("==")(dst[], "cccb");

Meta