[Issue 13615] stable sort not usable in @safe code
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Jun 7 22:58:02 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=13615
--- Comment #2 from Walter Bright <bugzilla at digitalmars.com> ---
Better test case:
@safe void foo()
{
import std.algorithm;
// Showcase stable sorting
string[] words = [ "aBc", "a", "abc", "b", "ABC", "c" ];
sort!("toUpper(a) < toUpper(b)", SwapStrategy.stable)(words);
assert(words == [ "a", "aBc", "abc", "ABC", "b", "c" ]);
}
--
More information about the Digitalmars-d-bugs
mailing list