src/sliceutils/general

Source   Edit  

Procs

func `@`[T, U](s: HSlice[T, U]): seq
Initializes a sequence from s. Uses len and pairs Source   Edit  
func sort[T](s: Slice[T]): Slice[T] {.inline.}
Swaps boundaries of s if s.b < s.a. Source   Edit  
func span[T, U: Ordinal](s: HSlice[T, U]): int {.inline.}
Alias for system.len(s). Source   Edit  
func spans[T, U: Ordinal; V](s: HSlice[T, U]; x: V): int {.inline.}
Alias for system.contains(s, x). Source   Edit  
func swap[T, U](s: HSlice[T, U]): HSlice[U, T] {.inline.}
Returns b .. a when given a .. b. Source   Edit  
func to[T, U](a: T; b: U): HSlice[T, U] {.inline.}
Alternate constructor for a .. b. Source   Edit  

Iterators

iterator pairs[T, U](s: HSlice[T, U]): auto {.noSideEffect.}
Returns (int, typeof(s.items, typeOfIter)), where the first element of the tuple is the count of iterations before. Only needs an items iterator defined on s. Source   Edit