Exception types thrown by delete?

Discussion in 'C++' started by Dill Hole, Jul 6, 2003.

  1. Dill Hole

    Dill Hole Guest

    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
    Dill Hole, Jul 6, 2003
    #1
    1. Advertising

  2. On Sat, 05 Jul 2003 19:53:36 -0700, Dill Hole <> wrote:

    >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.
    Alf P. Steinbach, Jul 6, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom
    Replies:
    1
    Views:
    417
    Munsifali Rashid
    Dec 11, 2003
  2. Selen
    Replies:
    0
    Views:
    2,662
    Selen
    May 28, 2004
  3. =?Utf-8?B?VmFs?=
    Replies:
    0
    Views:
    3,112
    =?Utf-8?B?VmFs?=
    Jun 8, 2005
  4. jobs
    Replies:
    1
    Views:
    1,861
    Scott Roberts
    Nov 16, 2007
  5. Val
    Replies:
    0
    Views:
    167
Loading...

Share This Page