Exception types thrown by delete?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dill Hole

    Exception types thrown by delete?

    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
  • Alf P. Steinbach

    #2
    Re: Exception types thrown by delete?

    On Sat, 05 Jul 2003 19:53:36 -0700, Dill Hole <dillhole@micro soft.com> wrote:
    [color=blue]
    >What type of exceptions can delete throw?[/color]

    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.

    [color=blue]
    > I am catching the exception with (...) but I would like
    >to know the explicit exception to catch.[/color]

    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.

    Comment

    Working...