There is a remove() method in std.algorithm!I even got asked why I was reimplementing it!
(well, because I didn't know it existed hey!)

works fine with, say, int...

but not with delegate!

associative array will solve the problem indeed.. (I hope) but they use way more memory!
it would be nice to have remove working() :)


Further, as you can see in my post, even my (reasonable) implementation of removeAt() fail! :(
(but, again, it works for int!)




"Andrej Mitrovic" wrote in message news:mailman.1010.1308495216.14074.digitalmars-d-le...@puremagic.com...

Remove takes an offset, not a value as far as I know.

If you need fast lookup and removal you could use hashes instead:

int main(string[] argv)
{
   auto a = new A;
   SlotDelegate x = &a.DIT;

   bool[SlotDelegate] _slotDg;
   _slotDg.remove(x);

   return 0;
}

Reply via email to