Removing multiple elements from array

MrSmith mrsmith33 at yandex.ru
Sat Dec 21 13:49:00 PST 2013


On Saturday, 21 December 2013 at 00:47:04 UTC, aldanor wrote:
> Is there an efficient method to remove elements with multiple 
> (compile-time-unknown) indices from an array? I currently do 
> something like
>
> 		if (!index.empty)
> 			foreach (i; index.sort.reverse)
> 				a = a.remove(i);
>
> ... which looks a bit awkward.

just use foreach_reverse


More information about the Digitalmars-d-learn mailing list