On Thu, 29 Apr 2010 08:20:35 +0200 Magnus wrote:
MF> > NEWS: snmplib: add remove function to container iterator; implement it for
MF> >  binary_array
MF> 
MF> You choose to let iterator::remove move to the previous entry. I assume
MF> this means you are ruling out the possibility of a single-linked list?

Well, I'm open for debate on the issue. My goal is to be able to remove an
item while iterating and keep the simple case simple. Using pseduocode:

  entry = itr_first;
  for( ; entry; ++itr) {
     // ...
     if (condition) {
        itr_remove;
        continue;
     }
     // ...
  }

I suppose another option is for remove to set a flag, and have ++itr not
actually advance if an item was removed... That should work for singly linked
lists to...  Thoughts?

------------------------------------------------------------------------------
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to