On Wednesday, 9 December 2015 at 13:23:00 UTC, Tim K. wrote:
On Wednesday, 9 December 2015 at 13:13:36 UTC, BBaz wrote:
1) remove works with an index
I guess I did read it wrong. Sorry.
Is there a convenience function that allows me to remove an/all
object(s) with a certain value from an array or do I need to
write one myself?
2) remove does not remove in place
That's fine.
void main(string[] argv)
{
A a = new A("a", 1);
A b = new A("b", 2);
A[] as = [a, b];
as = as.remove!(x => x == a);
writeln(as);
}
If array is sorted you can find the index of that element and
then remove it by index.