digitalmars.D.bugs - [Issue 14106] New: sort is safe in release mode, system in debug
- via Digitalmars-d-bugs (26/26) Feb 01 2015 https://issues.dlang.org/show_bug.cgi?id=14106
https://issues.dlang.org/show_bug.cgi?id=14106 Issue ID: 14106 Summary: sort is safe in release mode, system in debug mode Product: D Version: D2 Hardware: x86 OS: Mac OS X Status: NEW Severity: enhancement Priority: P1 Component: DMD Assignee: nobody puremagic.com Reporter: andrei erdani.com Repro: safe void main() { import std.algorithm : sort; import std.range : zip; int[] a = [ 1, 2, 3 ]; string[] b = [ "a", "b", "c" ]; sort!((c, d) => c[0] > d[0])(zip(a, b)); assert(a == [ 3, 2, 1 ]); assert(b == [ "c", "b", "a" ]); } Fails to compile with -debug, works otherwise. --
Feb 01 2015