January 22, 2015 topNIndex | ||||
|---|---|---|---|---|
| ||||
There's an undocumented function (2 overloads) called topNIndex that's still sitting in std.algorithm.package, 'cos I have no idea what it does and where it belongs.
1) Do we still want this function?
2) There's a bunch of dead code that has been commented out since 2009, including a function named topNIndexImpl. Does that mean that topNIndex is also dead code?
3) What is this function supposed to do? (OK OK, I can just read the
code, but I figured it's faster to ask here. :-P)
4) Should we keep it, or should we chuck it?
T
--
This is not a sentence.
| ||||
January 22, 2015 Re: topNIndex | ||||
|---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On 1/22/15 11:50 AM, H. S. Teoh via Digitalmars-d wrote: > There's an undocumented function (2 overloads) called topNIndex that's > still sitting in std.algorithm.package, 'cos I have no idea what it does > and where it belongs. > > 1) Do we still want this function? Yes. > 2) There's a bunch of dead code that has been commented out since 2009, > including a function named topNIndexImpl. Does that mean that topNIndex > is also dead code? topNIndex is supposed to be public. > 3) What is this function supposed to do? (OK OK, I can just read the > code, but I figured it's faster to ask here. :-P) void topNIndex( alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range, RangeIndex)(Range r, RangeIndex index, SortOutput sorted = SortOutput.no) if (isIntegral!(ElementType!(RangeIndex))); It stores the indices of the top `index.length` elements of `r` in `index`, without modifying `r`. > 4) Should we keep it, or should we chuck it? Keep. Andrei | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply