Exception types thrown by delete?

D

Dill Hole

What type of exceptions can delete throw? I am catching the exception
with (...) but I would like to know the explicit exception to catch.

TIA
 
A

Alf P. Steinbach

What type of exceptions can delete throw?

operator delete doesn't throw exceptions by itself. But a
deleted object's destructor may throw an exception, even
though that practice is generally regarded as unsound.

I am catching the exception with (...) but I would like
to know the explicit exception to catch.

There is a possibility that you're using Visual C++ where
catch(...) catches both C++ exceptions and native Windows
exceptions (SEH exceptions).

The best course of action is to correct the bug instead of
catching the exception.

I suggest you use a debugger.


Hth.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top