, , destructible
, , , .,
, , , , ,
24. .
:
try {
throw new std::exception("");
} catch(...) {
...
}
- , std::exception, , .
+ tryfinally, .
Object *p = new Object();
try{
...
}catch(...){
delete p;
throw;
}
deletep;
++ delete , , . , , , , . , , . , wrapper ( , ). , , .
25. , .
() throw, , :
throw [ ];
, throw, . , . , try -, , .
, , . , throw .
, Exception.
"Exception". , .
|
|
:
using namespace System;
public ref class EmployeeListNotFoundException: Exception
{
public:
EmployeeListNotFoundException()
{
}
EmployeeListNotFoundException(String^ message)
: Exception(message)
{
}
EmployeeListNotFoundException(String^ message, Exception^ inner)
: Exception(message, inner)
{
}
};
26. , .
: .
, , ( ) . , - .
, , .
, , . , Delphi ( overload).
, . .
27. .