In short, is it possible to force C ++ to force the invoker method to put a try ... catch block?
(To clarify: I do not necessarily mean the direct prosecutor, I mean to force the fact that he was caught somewhere. In addition, I'm talking about forcing during compilation.)
Long:
I read that it is not recommended to use the exception specification and that it does not work properly ( http://4thmouse.com/mystuff/articles/UsingExceptionsEffectively.html )
However, the general consensus seems to encourage the use of exceptions to return errors over user-written methods that return error codes.
So if I write, I will tell the library what to stop the user from calling my method without putting any attempts ... to block the blocks, and then cause it to crash the program when my code throws an exception?
(To be clear, I require that the exception be caught somewhere in the user stack, and not necessarily in the immediate caller, and the compiler must complain if this is not the case.)
source
share