remove element(s) from dyn array

bearophile bearophileHUGS at lycos.com
Fri Nov 19 07:26:43 PST 2010


spir:

> * Can I rely on
> 	a.length = a.length - 1
> to just remove the last element? If yes, is this considered good practice?

I think it's idiomatic in D, so it's OK.

Currently you may also write that as:
a.length -= 1;
But this is not supported yet:
a.length--;

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list