Consider the following code snippet:
try{
LibObject* obj = new LibObject();
if (!obj)
return 0;
}catch(...){
return 0;
}
return 1;
I don't know the implementation of the LibObject since it comes from an external library.
Generally speaking, could have any sense to check if the new object instance (obj) is NULL? Or the check is simply unuseful?
Could a new statement return a NULL object without throwing an exception?