No credit card required
Index tables are a genuinely useful idiom and a technique that's worth being aware of. But how can we implement the technique effectively… nay, even better than that, exceptionally?
Who benefits from clear, understandable code?
The following code presents an interesting and genuinely useful idiom for creating index tables into existing containers. For a more detailed explanation, see the original article [Hicks00].
Critique this code and identify:
Mechanical errors, such as invalid syntax or nonportable conventions.
Stylistic improvements that would improve code clarity, reusability, and maintainability.
// program sort_idxtbl(…) to make a permuted array of indices #include <vector> #include ...