"Exception safe" has two conditions:
1, do not disclose any resources
You can manage resources by object (ITEM13).
2. Data corruption is not allowed
The exception security function provides one of the following three guarantees
A. Basic commitment
If an exception is thrown, everything inside the program remains in a valid state, but what state is unknown.
B. Strong guarantee
If the exception is thrown, the program state does not change.
C, non-throwing (nothrow) guarantee
Note: Do not change the state of an object in order to indicate that something happened, unless that thing really happened.
Copy and swap policies.
Summary: The exception security function does not leak resources or allow any data structure to be corrupted even if an exception occurs, such functions are divided into three possible guarantees, basic type, strong type, non-throwing anomaly.
"Strong guarantees" can often be implemented with copy and swap, but "strong guarantees" are not achievable or meaningful for all functions.
The "Exception security guarantee" provided by the function is usually the highest of the weakest in the exception security guarantee for each function that it invokes.
Effective C + + (third Edition) Item29 for "Exception safe" is worth the effort