Tag Archives: concepts

Ordering by constraints

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

Posted in programming | Tagged , , , | 4 Comments

Requires-clause — updated

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

Posted in programming | Tagged , , , | 2 Comments

Requires-clause

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

Posted in programming | Tagged , , , | 6 Comments

Requires-expression

This post is about a C++20 feature, so we will be talking about the future. However, this is a very near feature, C++20 is expected to go out this year, and concepts look really stable, so the chances are high … Continue reading

Posted in programming | Tagged , | 17 Comments

Your own type predicate

In this post we will see how to define a type trait or a type predicate or a meta-function that would allow us to check at compile time whether a type exposes an interface that we need. That is, we … Continue reading

Posted in programming | Tagged , , , , , , | 18 Comments

Concepts Lite vs enable_if

This post contains quite advanced material. I assume you are already familiar with Concepts Lite. For an overview of what Concepts Lite is, I recommend this proposal. Also, I have found this blog very useful regarding the details of and … Continue reading

Posted in programming | Tagged , , , | 10 Comments

Diagnosable validity

Certain combinations of types and expressions can make a C++ program ill-formed. “Ill-formed” is a term taken from the C++ Standard and it means that a program is not valid, and compiler must (in most of the cases) reject it. … Continue reading

Posted in programming | Tagged , , , , | 8 Comments