Author Archives: Andrzej Krzemieński
In the previous post we have seen how you can create your own error-code enumeration for representing different reasons for failure in your component, and how you can store them and convey them type erased via std::error_code. In this post … Continue reading
I was recently implementing the “classification of error conditions” in my application offered by the functionality behind std::error_code. In this post I want to share some of my experience and insight. C++11 comes with a quite sophisticated mechanism for classifying … Continue reading
We will start with a bug, taken from real life. It spans across three files: Question: what happens when this program is executed?
Assertions (like C-style macro assert) are not an ideal, but still useful tool for indicating assumptions about program correctness, and help finding programmer bugs. In this post we will see how we can use assertions in constexpr functions. This works … Continue reading
This is a follow-up to my previous post about a bug in GCC. I was reading comments, and observed that some readers say that the example I used is rare, or artificial, or that it does not follow “good programming … Continue reading
This post is to inform you about a bug in GCC that may cause memory (or other resource) leaks in your valid C++ programs.