Sort in return statement
Seb
seb at wilzba.ch
Sat Dec 9 14:18:00 UTC 2017
On Saturday, 9 December 2017 at 14:05:36 UTC, rjframe wrote:
> On Sat, 09 Dec 2017 07:32:42 +0000, Seb wrote:
>
>>
>> Use .release to obtain the underlying array. No need to do
>> another allocation!
>>
>> ```
>> numbers.take(8).sort.release;
>> ```
>
> I did not realize that was there; thanks.
Yeah, you are very welcome. It's a bit hidden in the docs:
https://dlang.org/phobos/std_range.html#SortedRange
More information about the Digitalmars-d-learn
mailing list