FixedSizeArray.insertBack

This function inserts an S element at the back if there is space. Otherwise the behaviour is undefined.

  1. void insertBack(S t)
    struct FixedSizeArray(T, size_t Size = 32)
    pragma(inline, true) @trusted
    void
    insertBack
    (
    S
    )
    (
    auto ref S t
    )
    if (
    is(Unqual!(S) == T)
    )
  2. void insertBack(S s)
  3. void insertBack(S defaultValue, size_t num)

Examples

FixedSizeArray!(int,32) fsa;
fsa.insertBack(1337);
assert(fsa.length == 1);
assert(fsa[0] == 1337);

fsa.insertBack(99, 5);

foreach(it; fsa[1 .. fsa.length]) {
	assert(it == 99);
}

Meta