multiple catch types

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nick Keighley

    multiple catch types

    Hi,

    I have, unsuccessfully, checked the net and Stroustrup before I
    posted here.

    Is there a way to catch multiple exception types in a single catch
    statement?
    Something like:

    try
    {
    something();
    }
    catch (T1& T2& e)
    {
    cerr << "exception! " << e.what();
    }

    Perhaps it's expecting a bit much of the compiler.
    T1 and T2 do not have a common base class.

    I tried reading the syntax but got a bit lost. Is there an electronic
    version of the C++ syntax available somewhere? (I found one
    HTML version but it appeared to be only almost-C++).


    --
    Nick Keighley
Working...