Tag Archives: C++11
C++20 will come with what we call “Ranges” library. Meanwhile, range interface has been supported ever since C++11 in one context: range-based for loop. A range-based for loop can detect anything that is a range and work with it. In … Continue reading
Let’s start with the problem. I want to check whether a program received a text message that consists of four consecutive zeroes. Not ‘0’, but the numeric zero. I will create a constant std::string representing the special sequence and compare … Continue reading
In this post I would like to discuss two issues brought up by the readers regarding previous posts on using <system_error>: Storing 0 in error codes, and using non-0 success values. Concerns about using globals.
In the previous posts we have seen what error codes and error conditions are. But the way we used them is far from optimum. In particular, the implementation of FailureSourceCategory::equivalent was huge and error category FailureSourceCategory was forced to be … Continue reading