|
Boost Users : |
From: Ovidiu Deac (ovidiudeac_at_[hidden])
Date: 2005-01-18 03:27:32
Hello everybody,
We are going to use boost graph library within our application and I
would like to know if there are any known issues regarding the
exception safety. Is the basic guarantee satisfied? Is the strong
guarantee satisfied? (see Herb Sutter's definition of basic/strong
guarantee in Exceptional C++)
"Basic guarantee: Even in the presence of exceptions thrown by T or
other exceptions, Stack objects don't leak resources. Note that this
also implies that the container will be destructible and usable even
if an exception is thrown while performing some container operation.
However, if an exception is thrown, the container will be in a
consistent, but not necessarily predictable, state. Containers that
support the basic guarantee can work safely in some settings.
Strong guarantee: If an operation terminates because of an exception,
program state will remain unchanged. This always implies
commit-or-rollback semantics, including that no references or
iterators into the container be invalidated if an operation fails. For
example, if a Stack client calls Top and then attempts a Push that
fails because of an exception, then the state of the Stack object must
be unchanged and the reference returned from the prior call to Top
must still be valid." (Herb Sutter, Exceptional C++)
Thank you,
vidu
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net