Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I suppose you are technically correct that noexcept can throw to themselves. But that's just being pedantic, isn't it? From the observer/caller point of view the function won't ever throw. It will always return (or abort).


> I suppose you are technically correct that noexcept can throw to themselves. But that's just being pedantic, isn't it?

No. There are comments in this thread from people who are surprised that you can still handle exceptions within a noexcept function. Some seem to believe noexcept is supposed to mean "don't use exception within this scope". My comment is intended to clarify that, yes, you can throw and catch any exception from within a noexcept function, because noexcept does not mean "no exceptions within this scope" and instead only means "I should not allow exceptions to bubble up, and if I happen to do then just kill the app".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: