Tag Archives: exception handling

Destructors — 2 use cases

In this post I want to describe an interesting observation: programmers generally use destructors for two purposes. One is fairly obvious: releasing resources; the other — not necessarily so. Advertisements

Posted in programming | Tagged , , , | 3 Comments

noexcept — what for?

In this post I would like to share my observation on where using noexcept really adds value. It is less often than what one might expect, and it does not have that much to do with throwing or not throwing … Continue reading

Posted in programming | Tagged , , , , | 39 Comments

Find the bug — comments

In response to the previous post, I have received a bunch of very useful comments. I would like to share them here.

Posted in programming | Tagged , , | 1 Comment

noexcept destructors

The goal of this post is to show one — fairly small — backwards incompatibility in C++11. It shows how noexcept exception specifications are implicitly generated for your destructors. In short, the following program used to run successfully in C++03 … Continue reading

Posted in programming | Tagged , , , | 18 Comments

C++’s best feature

Update. My remark on exceptional life-time of temporaries in array initialization was incorrect. This part is now fixed. I also included some essential information, as suggested by Herb Sutter. C++, if you want to learn all of it, is big, … Continue reading

Posted in programming | Tagged , , , | 34 Comments

(Not) using std::thread

This post is about std::thread but not about threads or multi-threading. This is not an introduction to C++ threads. I assume that you are already familiar with Standard Library components thread and async. I encountered a couple of introductions to … Continue reading

Posted in programming | Tagged , , , | 30 Comments

Using std::terminate

In this article we are going to see what happens when your program calls std::terminate. If you think it simply terminates the program, you may find it interesting that it is not always so, and the function may be used … Continue reading

Posted in programming | Tagged , , | 10 Comments