First of all, code doesn't compile. error: call of overloaded 'processB(int)' is ambiguous It kind of suggests that the code is ill-formed. Answer to the first question. Before I jump into further explanations, I would suggest 2 sources to look at: CppReferences page - Constraints and Concepts (C++20) CppCon video - BackToBasics: Concepts Cpp reference article covers lots of ground and goes into great detail about Concepts. However, the language and examples used are sometimes hard to understand. That's where video comes in; Nicolai Josuttis's explanations of Concepts are great. Going back to the questions in the initial article D1: Core Language — Concepts, Constraint Subsumption, and Overload Resolution. Code, as I already mentioned, is ill-formed and doesn't compile. Let's try to understand why. Logically, we have declared similar concepts. SignedA and SignedB essentially define the same list of requirements for the fun...
C++17 introduced if constexpr , allowing conditional compilation of branches based on compile-time conditions. C++20 introduced std::is_constant_evaluated() , providing a way to determine whether an expression is being evaluated in a manifestly constant-evaluated context. C++23 added if consteval , offering a more direct mechanism for distinguishing constant-evaluated execution from runtime execution. All three features are part of published C++ standards. Consider the following code, compiled with C++23: #include <type_traits> #include <iostream> constexpr int Calculate(int value) { if constexpr (std::is_constant_evaluated()) { return value * 2; } else { return value * 3; } } int main() { constexpr int compileTime = Calculate(10); int input; std::cin >> input; int runtime = Calculate(input); std::cout << compileTime << '\n'; std::cout << runtime << '\n'; } ...