Implements a macro providing a compile-time quicksort function for arrays of any length, containing any primitive Copy type with a PartialOrd implementation.
Contributions/suggestions/etc. very welcome!
Minimum supported Rust version: due to the use of unstable const fn features, this is a nightly-only crate at the moment.
Fully #![no_std] compatible by default.
A basic usage example:
use staticsort;
static X: = ;
static Y: = ;
// The macro takes the following parameters in the order they're
// listed: type to sort, index to start at, index to end at, total
// array length, and either the name of an existing const / static
// array variable or a directly-passed "anonymous" array.
// Sort all of X:
static XX: = staticsort!;
// Just sort half of Y:
static YY: = staticsort!;
// Sort all of an array that's the same as X, but passed
// directly as a parameter:
static ZZ: = staticsort!;
License:
Licensed under either the MIT license or version 2.0 of the Apache License. Your choice as to which! Any source code contributions will be dual-licensed in the same fashion.