B
barcaroller
The boost::exception tutorial states that the user should derive from both
std::exception and boost::exception, as show below:
struct exception_base: virtual std::exception,
virtual boost::exception
{
};
The tutorial then shows how to catch one such exception, as shown below:
catch (exception_base& e)
{
// take action
// can I call what()?
}
My question is: how will I know that I received a std::exception object so
that I can call its what() member function (which boost::exception does not
have)?
std::exception and boost::exception, as show below:
struct exception_base: virtual std::exception,
virtual boost::exception
{
};
The tutorial then shows how to catch one such exception, as shown below:
catch (exception_base& e)
{
// take action
// can I call what()?
}
My question is: how will I know that I received a std::exception object so
that I can call its what() member function (which boost::exception does not
have)?