December 09, 2017 Re: Sort in return statement | ||||
---|---|---|---|---|
| ||||
Posted in reply to codephantom | On Saturday, 9 December 2017 at 14:42:44 UTC, codephantom wrote:
> After lots of reading, and testing, I managed to get a simple, one liner ;-)
> (doesn't seem like .release is needed though.)
FYI .release is only possible on a SortedRange and then yields the underlying range. randomSample doesn't sort its returned range, but I am glad to hear this worked for you.
|
December 09, 2017 Re: Sort in return statement | ||||
---|---|---|---|---|
| ||||
Posted in reply to Seb | On Saturday, 9 December 2017 at 14:49:28 UTC, Seb wrote:
>
> randomSample doesn't sort its returned range
Not by design, however, because it samples in the order that the elements appear, *if* those elements are already sorted (whether by design or explicately sorted), then the results of the randomsample are also implicitly already sorted ;-)
|
Copyright © 1999-2021 by the D Language Foundation