Tag Archives: type system
In the previous post we have seen how constraint conjunction and disjunction works, and how a function template with constraints is a better match than a function template without constraints (provided that the constraints are satisfied) when determining the best … Continue reading
The previous post, “Requires-clause”, contained incorrect information about parentheses inside a requires-clause. Token || inside parentheses is still interpretted as a disjunction of two constraints. I apologize for misleading the readers. I also want to thank James Pfeffer for bringing … Continue reading
Update. This post in its original form contained incorrect information about the meaning of parentheses inside requires-clauses in section Conjunction and Disjunction. The section has now been changed to correct this. The updated text is in blueish color. Even if … 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
We will start with a bug, taken from real life. It spans across three files: Question: what happens when this program is executed?
Have you ever seen a function call like this? We are processing something: this should be clear from the context. But what do these parameters mean? What is true and what is false? From the function call we will never … Continue reading