multiple catch types

N

Nick Keighley

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++).
 

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
474,171
Messages
2,570,935
Members
47,472
Latest member
KarissaBor

Latest Threads

Top