RE: [gtkmm] deleting last childrow of a row
- From: <kickvb touva be>
- To: <Erik echohome org>, <gtkmm-list gnome org>
- Subject: RE: [gtkmm] deleting last childrow of a row
- Date: Thu, 27 Nov 2003 15:06:09 -0000
> I've used the end() call and the -- operator with success.
But you need to test if the list is not empty, so I think you can make
someting like:
// get iterator of last element
list<foo>::iterator it = list.end()--;
// check that list is not empty
if (it != list.end()) {
// get last element
foo = *it;
// if you want to delete it
it = list.erase(it);
}
Regards,
Christian Van Brussel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]