C++: exception: out-of-order execution?# Programming - 葵花宝典
e*a
1 楼
There are situations that exception could be throw within constructor and we
usually employ auto_ptr to protect resources. But if we do not have auto_
ptr can we use the following technique to handle it?
Please search "QUESTION" and see my question.
Thanks!
#include
using namespace std;
class E1 {
public: E1() {
int i = 1;
int j = 2;
int k = 3;
printf("i = %d, j = %d,
usually employ auto_ptr to protect resources. But if we do not have auto_
ptr can we use the following technique to handle it?
Please search "QUESTION" and see my question.
Thanks!
#include
using namespace std;
class E1 {
public: E1() {
int i = 1;
int j = 2;
int k = 3;
printf("i = %d, j = %d,