Levels of exception safety in C++

P

Pallav singh

Hi All ,

I am new to C++. I was looking to several levels of exception safety:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Basic exception safety: Partial execution of failed operations can
cause
side effects, but invariants on the state are preserved. Any stored
data will
contain valid values even if data has different values now from before
the exception.

http://en.wikipedia.org/wiki/Exception_handling
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
stable state. An object's state is stable if none of its member or
friend
functions, when called with arguments that
satisfy their
preconditions, result in undefined behavior.
[Note: in particular, this applies to the object's destructor.]
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/1997/N1077.asc
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I am not able to understand them. How can they occur in Code.

Thanks in Advance
Pallav Singh
 
J

James Kanze

"Pallav singh" <[email protected]> > Hi All ,
I did read something about exception safe in C++,
Here is a good reading/discussing on the three levels safety.

Bof. Like in the newsgroups, you have to be selective. The way
the original question was phrased, it sounded almost like a
troll. One of the responses was very good, but the rest varied
from ordinary to downright bad. (Your reaction seems to be to
the one that was good, because it was the only one which
mentionned the different levels of exception safety.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top