array idioms
spir
denis.spir at gmail.com
Fri Feb 25 13:56:55 PST 2011
On 02/25/2011 08:55 PM, Andrej Mitrovic wrote:
> On 2/25/11, spir<denis.spir at gmail.com> wrote:
>> * delete an element in an associative array
>
> Just use .remove?
>
> void main()
> {
> auto var = ["a" : 1];
> var.remove("b"); // nothing happens
> var.remove("a"); // "a" key is gone
>
> assert(!var.length); // empty
> }
Sh*t, I have missed it. Sorry for the no*se. But where is this func
implemented? I could not find it by browsing. (It's also not in object.d,
apparently; while usually when I cannot find something, it's hidden in there ;-)
Denis
--
_________________
vita es estrany
spir.wikidot.com
More information about the Digitalmars-d-learn
mailing list