Original Post
I'm working on the design of my little virtual machine, and it's becoming apparent that the use of exceptions would simplify the handling... This is because a number of errors can occur during the execution, and I do need to perform some testing for them, but without exception handling, it's difficult to stop the VM to proceed with what it was doing... I actually have to either test for errors twice, or make sure functions that are to give access to certain resources return references to "dummy" resources when given invalid parameters... Which is rather unclean. I have heard before that C++ exceptions are "slow". But I am wondering whether they are slow when they are actually thrown (which is not a problem in my case, since two execution errors can't happen, since the VM will stop at the first)... Or if they actually slow all of the code that can throw or catch exceptions all the time. I am also wondering, for typed exceptions, where you throw an object as an exception, do those actually require RTTI to be enabled?