To determine if an atomic constraint is
satisfied,
the parameter mapping and template arguments are
first substituted into its expression
. If substitution results in an invalid type or expression,
the constraint is not satisfied
. The constraint is satisfied if and only if evaluation of
E
results in
true. If, at different points in the program, the satisfaction result is different
for identical atomic constraints and template arguments,
the program is ill-formed, no diagnostic required
. [
Example 3:
template<typename T> concept C =
sizeof(T) == 4 && !true;
template<typename T> struct S {
constexpr operator bool() const { return true; }
};
template<typename T> requires (S<T>{})
void f(T);
void f(int);
void g() {
f(0);
}
—
end example]