title: c++ sort keeping track of indices
body: <p>Do you have some efficient routine for returning array with indices for sorted elements in a array? I think that some convenient way exists using stl <code>vector</code>. Do you have already implemented an efficient algo without stl, or do you have a reference to pseudo code or C++ code?</p>