Skip to content

num::remove_indices

Defined in header <container/swap_remove.hpp>

template <typename T>
void remove_indices(array<T> &values, view<const idx> removed);

Remove the elements at removed and keep the others in their order.

The order-preserving counterpart of swap_remove: it costs one pass over the array instead of one move per removal.

Exceptions

  • std::out_of_range: If an index is not less than values.size().