On Thursday, 11 June 2015 at 21:57:36 UTC, Dave wrote:

assume I misunderstood him.

Yeah, its whatever, maybe I am misunderstanding him and your original interpretation is correct.

That is a legitimate concern, but I don't think it is correct.
The transitive nature would enforce that you at least handle it
at some point along the chain. Nothing would force you to handle
it right away.

I think the sticky point is where this starts to hit virtual functions, function pointers, delegates and the such as its not really known if they are going to throw or not. You basically have to assume that they will throw which means annotating a lot of code that you didn't have to before.

I guess you could think of nothrow as an acknowledgement. I'd
view it more like a warning to others. As I said before, I don't
think you should be *forced* to do anything. Handle it right away
and you don't have to mark your own function as 'throw'. Don't
handle it, then your function should be marked 'throw', and the
compiler can help others out and tell them to expect to have to
handle the exception at some point.

Personally I would get annoyed by that because now I would have to go though and mark almost all of my code as throw. I strongly dislike having to add a bunch of annotations to my code just to get it to work.

I get that warning others is a good thing, but its also not necessary. Personally I would prefer something like that to be a tool, some one mentioned IDE's that can display what exceptions could be thrown, I think that would be nifty without bogging my code down with a bunch of annotations. Though the list it displays may be incomplete due to function pointers and such.

Reply via email to