DArray.insertBack

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

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

Examples

1 DArray!(int) fsa;
2 fsa.insertBack(1337);
3 assert(fsa.length == 1);
4 assert(fsa[0] == 1337);
5 
6 fsa.insertBack(99, 5);
7 
8 foreach(it; fsa[1 .. fsa.length]) {
9 	assert(it == 99);
10 }

Meta