Check that output indices are stored
Compare changes
The c++ algorithm std::is_sorted
is marked with the attribute nodiscard
. The result of the check that the output indexset is sorted is currently lost. This MR wraps this check in an if-not-then-throw block.