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: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 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: -------