// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package sort

// Slice sorts the provided slice given the provided less function.
//
// The sort is not guaranteed to be stable. For a stable sort, use
// SliceStable.
//
// The function panics if the provided interface is not a slice.
func ( interface{},  func(,  int) bool) {
	 := reflectValueOf()
	 := reflectSwapper()
	 := .Len()
	quickSort_func(lessSwap{, }, 0, , maxDepth())
}

// SliceStable sorts the provided slice given the provided less
// function while keeping the original order of equal elements.
//
// The function panics if the provided interface is not a slice.
func ( interface{},  func(,  int) bool) {
	 := reflectValueOf()
	 := reflectSwapper()
	stable_func(lessSwap{, }, .Len())
}

// SliceIsSorted tests whether a slice is sorted.
//
// The function panics if the provided interface is not a slice.
func ( interface{},  func(,  int) bool) bool {
	 := reflectValueOf()
	 := .Len()
	for  :=  - 1;  > 0; -- {
		if (, -1) {
			return false
		}
	}
	return true
}