K
Kuba_O
Hello, i've got simple question about std::auto_ptr: what makes it is
exceptions safe?
Lets say i have class "int_smart_ptr" implemented like this:
class int_smart_ptr
{
private:
int *int_obj;
public:
explicit int_smart_ptr(int *_p)throw():int_obj(_p){}
~int_smart_ptr()throw(){delete int_obj;}
};
Is this class exception safe? When exception occur in scope in
int_smart_ptr was use, would destructor be call?
If yes, why?
If not, what feature of std::auto_ptr decide it is safe in case of
exception?
I hope someone understand my english
Regards
Kuba
exceptions safe?
Lets say i have class "int_smart_ptr" implemented like this:
class int_smart_ptr
{
private:
int *int_obj;
public:
explicit int_smart_ptr(int *_p)throw():int_obj(_p){}
~int_smart_ptr()throw(){delete int_obj;}
};
Is this class exception safe? When exception occur in scope in
int_smart_ptr was use, would destructor be call?
If yes, why?
If not, what feature of std::auto_ptr decide it is safe in case of
exception?
I hope someone understand my english
Regards
Kuba