www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8343] New: Last argument of topNCopy forcing a sort?

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 puremagic.com
        ReportedBy: bearophile_hugs eml.cc



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: -------
Jul 03 2012