target containing the copied elements.topNCopy
fn
TRange topNCopy(alias less = "a < b", SRange, TRange)(SRange source, TRange target, SortOutput sorted = No.sortOutput) if (isInputRange!(SRange) && isRandomAccessRange!(TRange)
&& hasLength!(TRange) && hasSlicing!(TRange))Copies the top n elements of the
source into the
random-access range target, where n = target.length.
Elements of source are not touched. If sorted is true, the target is sorted. Otherwise, the target respects the heap property.
Parameters
less | The predicate to sort by. |
source | The source range. |
target | The target range. |
sorted | Whether to sort the elements copied into target. |
Returns
The slice of