About Exception Specification Conformance

Started by
1 comment, last by Xeee 20 years, 1 month ago
Why Isn''t Exception Specification Conformance Checking Compile-Time Instead of RunTime. What happens now is that if the function throws an exception which doesn''t belong to its exception specification, unexpected() will be called, y not check it at compile time, and generate a compilation error, instead of doing it at runtime?? I was just wondering xee.. Speed is not the only thing that matters, Quality does TOO!
xee..
Advertisement
Well, basically because you can''t tell what exceptions a function will throw. The function will call other functions, which the compiler may not have access to. And I guess it''d be a pain to keep track of all those possible exceptions.
It could have been done that way, but it would have been a lot more work so it wasn''t... and no one uses exception specifications other than throw() (even that use is uncommon).
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

This topic is closed to new replies.

Advertisement