> tmp=current->next();
> current->next(add);
> add->next(tmp);
> add->prev(current);
> if(tmp) tmp->prev(add);
>
> What happens to our list if _any_ of the above member functions throw an
> unexpected exception?
If your point is that destructor-based cleanup doesn't cover
everything -- well, it's a fair cop. But manual cleanup with 'try'
and 'catch' is the obvious case; I thought it was necessary to
demonstrate the destructor-based approach, since it covers lots of
things and is much easier to verify correct.
-- Chip Salzenberg - a.k.a. - <chip@perlsupport.com> "When do you work?" "Whenever I'm not busy."- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/