3 ms·
Which is how you get zero cost unless thrown. You're gonna have to pay for something.
by mike_hock 4y ago
Which is how you get zero cost unless thrown. You're gonna have to pay for something.
- kllrnohj 4y agoThe RTTI requirement is more of an issue since that's forcing RTTI on for all types, not just those that can be thrown as exceptions. An explicit "throws" syntax would eliminate that (since the thrown type is now statically known and doesn't require RTTI) and thus significantly cut down on the cost. Alternatively, and this isn't very "C++" but would work, it could be required that all thrown exceptions must inherit from a base "Exception" type such that you then only need to require RTTI for that chain of types instead of all types.