2 ms·
A possible solution would have been optional static enforcement of exception specifications plus fallback on the existing dynamic enforcement. Existing unmarke
by gpderetta 10y ago
A possible solution would have been optional static enforcement of exception specifications plus fallback on the existing dynamic enforcement.
Existing unmarked functions would be expeced to possibly throw everything, while functions with throw specifications would be statically checked.
You can call the later from the former, but to do the reverse you need an explicit try/catch. Some form of throw(auto) would enable automatic deduction of exception specifications for e.g. template code.
Dyanamic exception specifications will be removed fron the language in c++17, so the synax is open to be reused for such a feature in the future.
- palunon 10y agoThe problem is C code. You know it won't throw, but there will never be any exception specification on it.