[gtkmm] Gtkmm iterators



I'm using a Gtk::MenuShell::MenuList::iterator to look through the
items in an OptionMenu and then erase items I no longer want:

      	  Gtk::MenuShell::iterator cur = items().begin();
	  while (cur != items().end())
	    {
              [checks here]
		  if ([check was valid])
		    {
		      items().erase(cur);
		    }
		}
	    }

Question: is the iterator invalidated by the erase()?

Do the same iterator semantics apply to all other lists based on
GLib::HelperList<>?


Many thanks,
Roger

-- 
Roger Leigh

                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]