c++ - When using noexcept, how can I be certain that my code wil not throw an exception? -
c++ - When using noexcept, how can I be certain that my code wil not throw an exception? -
i understand writing exception-safe code means taking business relationship part of code can throw exception, can offer guarantee behavior when exception indeed thrown. in particular, take best write code nothrow guarantee if situation permits it.
the thing is, how know code cannot throw?
more precisely:
let's functions utilize cannot throw (they havenoexcept(true)
specifier, check static_assert, , implemented ensure it). knowing that, can still throw, operations on basic types or function calls throw (not function itself, function call)? can error occur without leading exception (for example, heard dividing int 0 results in error, not throw) c++ exception
Comments
Post a Comment