The handler std::terminate() is called whenever the exception handling mechanism cannot find a suitable catch clause for a thrown exception (and in some other cases. For example, when an exception is thrown during the handling of another exception – see this GotW post about std::uncaught_exception). It is possible to define a custom handler by using [...]
Archive for the ‘mechanisms’ Category
Catching uncaught exceptions within terminate
Posted in mechanisms on 21/03/2010 | 1 Comment »
Template template parameters
Posted in mechanisms on 19/10/2009 | Leave a Comment »
This is actually not a typo, I really meant to repeat the first word. Let’s see what template template parameters are..
Exception specifications
Posted in mechanisms on 06/10/2009 | 7 Comments »
C++ provides a mechanism that allows any function to declare exactly which exception types it may throw, and these declerations are actually enforced in runtime. We will review exactly how this mechanism works, and why it is usually left unused.
Virtual dispatching within a constructor/destructor
Posted in mechanisms on 30/09/2009 | 5 Comments »
This post continues and explains the previous erroneous post. In the example from the previous post, our base class has invoked a virtual function during the construction of the object, expecting that the correct function would be called. Why was that an error, you ask ?
Everything about namespaces
Posted in mechanisms on 24/09/2009 | Leave a Comment »
I’ll assume you are already familiar with the concept of namespaces, and the using keyword. So let me try and introduce some of the less common features of the namespace mechanism.
Reference to temporary
Posted in mechanisms on 20/09/2009 | Leave a Comment »
This article will discuss references to temporary objects - a mechanism with a few subtleties.
Mutable and volatile
Posted in mechanisms on 16/09/2009 | 2 Comments »
I am a little busy nowadays, so excuse me for posting yet another somehow basic article. However, I still retain the hope that some of you are not familiar enough with at least one of these two keywords in C++.