The Adventures of Joshua Judson Rosen
(action man)

[ sections: VisualIDs | art | movies | everything ]


Wed, 12 Jun 2002
[@]

23:12: #(0x7d2 6 12)

Stroustrup seems really annoying. In the C++ Style and Technique FAQ, he #{writes:}#

Why can't I resume after catching an exception?

In other words, why doesn't C++ provide a primitive for returning to the point from which an exception was thrown and continuing execution from there?

Basically, someone resuming from an exception handler can never be sure that the code after the point of throw was written to deal with the excecution just continuing as if nothing had happened. An exception handler cannot know how much context to "get right" before resuming. To get such code right, the writer of the throw and the writer of the catch need intimate knowledge of each others code and context.

Why is that? Is it because this is some innate universal truth, or is it just because that's the way that C++ is designed (which would reduce the reason to `C++ doesn't have continuable exceptions because C++ doesn't have continuable exceptions')? Gotta love his frequent `if you want to know the answer, buy my book!' pseudo-answers, too....

He does provide a link to a discussion-log in which he (of course) says, `buy my book!', but also quotes from the book, which states, basically, that experience has demonstrated continuation-semantics to be un-necessary and continuation-implementations to be slow. So, the conclusion is that, if something is slow and not necessary, it should not be included in C++. Funny.

[7d2.6.0c-00: meta-source]

[Reply]