About Exception Specification Conformance
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!
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).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement