[Issue 8343] Last argument of topNCopy forcing a sort?
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Aug 17 04:47:42 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=8343
RazvanN <razvan.nitu1305 at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |razvan.nitu1305 at gmail.com
--- Comment #1 from RazvanN <razvan.nitu1305 at gmail.com> ---
>From docs : "If sorted is true, the target is sorted. Otherwise, the target
respects the heap property" [1].
[1] https://dlang.org/phobos/std_algorithm_sorting.html#topNCopy
> But if the programmer gives "true" as the last argument, can't topNCopy just sort the little result calling sort() on it before returning?
That is exactly what it does.
Closing as invalid.
--
More information about the Digitalmars-d-bugs
mailing list