Posted by: rmn on: 30/11/2010
Using the initialization list is very much encouraged in C++, and rightfully so - it has many benefits. But what happens if one of your members fails at initialization and actually throws an exception? Even worse: what happens if that member’s constructor throws an exception not in your exception specification list?
Posted by: rmn on: 31/10/2010
Quoting Wikipedia: The word thunk has at least three related meanings in computing science. A “thunk” may be: A piece of code to perform a delayed computation (similar to a closure) A feature of some virtual function table implementations (similar to a wrapper function) A mapping of machine data from one system-specific form to another, [...]
Posted by: rmn on: 21/03/2010
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 [...]
Posted by: rmn on: 19/10/2009
This is actually not a typo, I really meant to repeat the first word. Let’s see what template template parameters are..
Posted by: rmn on: 06/10/2009
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.
Posted by: rmn on: 30/09/2009
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 ?
Posted by: rmn on: 24/09/2009
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.
Recent comments