On Saturday, 21 December 2013 at 03:22:22 UTC, H. S. Teoh wrote:
Unfortunately, while std.algorithm.remove does provide a way to do this if the number of indices to remove are known beforehand, it doesn't seem to be able to remove a dynamic list of indices. Probably an enhancement
request should be filed:

        http://d.puremagic.com/issues

If the number of indices to remove are fixed, though, you can do this:

        import std.algorithm : remove;
        int[] arr = [ ... ];
        int i1, i2, i3;  // indices to remove
        arr = arr.remove(i1, i2, i3);

Yes, this is exactly why I opened this thread initially, I noticed this functionality in .remove() and was native enough to assume there's a shortcut for batch removal with indices unknown in advance :)

Reply via email to