I was making some tests with the noexcept
operator, my method calls a method that throws an exception, that exception should be caught in a catch:
void method() noexcept
{
try
{
foo(); // <-- throws
}
catch(...)
{
some code...;
}
}
What I expected, as I catch every exception, there should be no problem with the noexcept.
What's happening, when foo() throws, the program crashes. If I remove the noexcept, it works as expected.
No compiler errors.
What am I missing?
Aucun commentaire:
Enregistrer un commentaire