On Wednesday, November 13, 2013 11:02:15 bearophile wrote: > I'd like dmd to give a deprecation warning when you use a > built-in sort.
Agreed, but it's not officially deprecated yet, much as I think that it's supposed to be. > And regarding sorting ASCII chars, it's a common need. I usually > do it this way (if the input array of chars is mutable the code > could spare the dup): Sure, but you can't sort it as char[] that way, and you have to be sure that you're dealing with ASCII-only. > string s = "test"; > string t = cast(string)(s.dup.representation.sort().release); I keep forgetting about std.string.representation. I always end up casting (though representation is arguably better). - Jonathan M Davis
