Array.sort

Sort the elements of an array

This function relies on qsort.

  1. typeof(this) sort()
    struct Array(T)
    extern (D) ref nothrow
    typeof(this)
    sort
    (
    alias pred
    )
    ()
  2. typeof(this) sort()

Parameters

pred

Predicate to use. Should be a function of type int function(scope const T* e1, scope const T* e2) nothrow. The return value of this function should follow the usual C rule: e1 >= e2 ? (e1 > e2) : -1. The function can have D linkage.

Return Value

Type: typeof(this)

A reference to this, for easy chaining.

Meta