12 Templates [temp]

12.4 Template constraints [temp.constr]

12.4.1 Constraints [temp.constr.constr]

12.4.1.1 Logical operations [temp.constr.op]

There are two binary logical operations on constraints: conjunction and disjunction.
[Note
:
These logical operations have no corresponding C++ syntax.
For the purpose of exposition, conjunction is spelled using the symbol and disjunction is spelled using the symbol .
The operands of these operations are called the left and right operands.
In the constraint , A is the left operand, and B is the right operand.
end note
]
A conjunction is a constraint taking two operands.
To determine if a conjunction is satisfied, the satisfaction of the first operand is checked.
If that is not satisfied, the conjunction is not satisfied.
Otherwise, the conjunction is satisfied if and only if the second operand is satisfied.
A disjunction is a constraint taking two operands.
To determine if a disjunction is satisfied, the satisfaction of the first operand is checked.
If that is satisfied, the disjunction is satisfied.
Otherwise, the disjunction is satisfied if and only if the second operand is satisfied.
[Example
:
template<typename T>
  constexpr bool get_value() { return T::value; }

template<typename T>
  requires (sizeof(T) > 1) && get_value<T>()
    void f(T);      // has associated constraint sizeof(T) > 1  get_­value<T>()

void f(int);

f('a'); // OK: calls f(int)
In the satisfaction of the associated constraints of f, the constraint sizeof(char) > 1 is not satisfied; the second operand is not checked for satisfaction.
end example
]