views:

115

answers:

3
+1  Q: 

exception handling

Is there any section in c++ for which we can not handle exceptions?

+1  A: 

You can throw an exception of your own and handle it. Are you trying to say places like constructors destructor in which case you can refer the following http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.2

Can you be more specific. What exactly are you looking for.

ckv
any pre/user defined function or variables for which we can not handle exception
@lalmay-j, what exactly do you mean by "can not handle exception"? Please add this clarification as an update to your original question, and remove this comment. SO is not working like a discussion forum.
Péter Török
+1  A: 

well the destructor must never throw and you must not use exception in signal handlers because that almost always doesn't end well if that's what your asking but your question is a bit vague.

Olorin
More like the destructor *shouldn't* throw, but it's perfectly fine to. I think the question isn't about should but about require.
GMan
MSalters
+1  A: 

There is only one situation where an exception handler cannot handle an exception - a function try/catch block around a constructor.

The catch block(s) can translate the exception caught, but they cannot exit without throwing. See here for a more complete discussion.


If you were asking about places from where exceptions cannot be thrown instead of where they cannot be handled then...

Throwing an exception fro a destructor is extremely ill advised. The circumstances under which it is safe are so hard to guarantee that you should just avoid ever throwing from a destructor.

Joe Gauterin