SList.insertAfter

Similar to insertAfter above, but accepts a range bounded in count. This is important for ensuring fast insertions in the middle of the list. For fast insertions after a specified position r, use insertAfter(take(r, 1), stuff). The complexity of that operation only depends on the number of elements in stuff.

Precondition: r.original.empty || r.maxLength > 0

  1. size_t insertAfter(Range r, Stuff stuff)
  2. size_t insertAfter(Take!Range r, Stuff stuff)
    struct SList(T)
    size_t
    insertAfter
    (
    Stuff
    )
    (,
    Stuff stuff
    )
    if ()
    if (
    !is(T == shared)
    )

Return Value

Type: size_t

The number of values inserted.

Complexity: O(k + m), where k is the number of elements in r and m is the length of stuff.

Meta