digitalmars.D.bugs - [Issue 8342] New: Truly sorted output for topNCopy(zip())?
- d-bugmail puremagic.com (29/29) Jul 03 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8342
http://d.puremagic.com/issues/show_bug.cgi?id=8342 Summary: Truly sorted output for topNCopy(zip())? Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: Phobos AssignedTo: nobody puremagic.com ReportedBy: bearophile_hugs eml.cc --- Comment #0 from bearophile_hugs eml.cc 2012-07-03 13:18:02 PDT --- Related to Issue 8341 I think in this case topNCopy should be able to generate a truly sorted output (instead of a heap): import std.stdio, std.algorithm, std.range, std.typecons; void main() { auto a = [10, 20, 30]; auto b = ["c", "b", "a"]; Tuple!(int, string)[4] sorted_ab; writeln(a, " ", b); topNCopy!q{a > b}(zip(a, b), sorted_ab[], true); // error topNCopy!q{a > b}(zip(a, b), sorted_ab[]); // OK writeln(a, " ", b); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 03 2012