mardi 10 mars 2015

Can a function marked as noexcept have exceptions inside?

Let's say that I have a function marked as noexcept but there's a line of code inside that can throw. That line of code will be in a try block and the exception will be caught. Does that cause anything?



void MyFunc() noexcept
{
try {
throw std::exception("...");
} catch (const std::exception & e) {
// I'll deal with it here...
}
}

Aucun commentaire:

Enregistrer un commentaire