+ followed it. Undefined behavior if ELEM is not in a list.
+
+ A list element must be treated very carefully after removing
+ it from its list. Calling list_next() or list_prev() on ELEM
+ will return the item that was previously before or after ELEM,
+ but, e.g., list_prev(list_next(ELEM)) is no longer ELEM!
+
+ The list_remove() return value provides a convenient way to
+ iterate and remove elements from a list:
+
+ for (e = list_begin (&list); e != list_end (&list); e = list_remove (e))
+ {
+ ...do something with e...
+ }
+
+ If you need to free() elements of the list then you need to be
+ more conservative. Here's an alternate strategy that works
+ even in that case:
+
+ while (!list_empty (&list))
+ {
+ struct list_elem *e = list_pop_front (&list);
+ ...do something with e...
+ }
+*/
+struct list_elem *
+list_remove (struct list_elem *elem)