[Issue 8343] New: Last argument of topNCopy forcing a sort?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 3 13:21:09 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8343

           Summary: Last argument of topNCopy forcing a sort?
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2012-07-03 13:21:08 PDT ---
See also Issue 8342

Currently I think topNCopy gives a heap instead of a sorted output when you
give it a range that can't be sorted. In this case the last argument of
topNCopy must be false (that is the default).

But if the programmer gives "true" as the last argument, can't topNCopy just
sort the little result calling sort() on it before returning? This way you
don't have to call sort() yourself on the result if you need it truly sorted.

(Please close this enhancement request if I am missing something.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list