RosettaCodeData/Task/Exceptions/C++/exceptions-3.cpp
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

17 lines
382 B
C++

// this function can throw any type of exception
void foo()
{
throw MyException();
}
// this function can only throw the types of exceptions that are listed
void foo2() throw(MyException)
{
throw MyException();
}
// this function turns any exceptions other than MyException into std::bad_exception
void foo3() throw(MyException, std::bad_exception)
{
throw MyException();
}