phobos/changelog/std-meta-staticissorted.dd
2017-01-13 21:40:20 +01:00

16 lines
669 B
Text

Added `std.meta.staticIsSorted` to check if an `AliasSeq` is sorted according to some template predicate.
`std.meta.staticIsSorted` checks whether an `AliasSeq` is
sorted according to some template predicate.
------
enum Comp(T1, T2) = T1.sizeof < T2.sizeof;
import std.meta : staticIsSorted;
static assert( staticIsSorted!(Comp, byte, uint, double));
static assert(!staticIsSorted!(Comp, bool, long, dchar));
------
Additionally, the compile-time performance of `std.meta.staticSort` has been
greatly improved. Nevertheless, due to compiler limitations it is still an
extraordinarily expensive operation to perform on longer sequences; strive to
minimize such use.