indirect_adapter: use a trick to simplify the new algorithm
indirect_adapter: use a trick to simplify the new algorithm

Directly inspired by Boost.Algorithm apply_permutation algorithm. It is
very similar to indiesort's own permutation algorithm but has an
interesting twist to it: instead of maintaining a "sorted" sentinel to
keep track of already permuted element, it stores its final position
back into the original_index field in order to fail the condition that
decides whether an element is the start of a cycle or not (an element
already in it sorted position does not start a cycle).

Additionally it allows to remove the dependency on std::numeric_limits,
which means that hypothetical exotic pointer types that do not support
the std::numeric_limits template can now work with indirect_adapter.

Morwenn/cpp-sort,Morwenn/cpp-sort,Morwenn/cpp-sort,Morwenn/cpp-sort