SList.stableInsertAfter

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

struct SList(T)
alias stableInsertAfter = insertAfter

Return Value

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