Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::category::HasLogicalOperators Concept Referenceexport

Pure syntactic shape: T supports the logical operators &&, ||, ! with closed results. More...

Concept definition

template<typename T>
concept dedekind::category::HasLogicalOperators = requires(T a, T b) {
{ a && b } -> std::same_as<T>;
{ a || b } -> std::same_as<T>;
{ !a } -> std::same_as<T>;
}
Pure syntactic shape: T supports the logical operators &&, ||, ! with closed results.
Definition logic.cppm:537

Detailed Description

Pure syntactic shape: T supports the logical operators &&, ||, ! with closed results.

Use this concept where the callsite needs Boolean-flavoured logical operators (rather than the bitwise lattice operators of dedekind::order::HasLatticeOperators) — bool, Ternary, predicate carriers, Kleene three-valued logic. No axiomatic claim is made about truth tables or excluded-middle. Note also that short-circuit evaluation of && / || is guaranteed only for the built-in operators on bool; once && / || are overloaded for a user-defined T they evaluate like ordinary functions (both operands always evaluated, in unspecified order), so this concept makes no short-circuit claim either. Sibling of dedekind::algebra::HasRingOperators (in algebra:ring) and dedekind::order::HasLatticeOperators (in order:lattice) in the shape-concept family — introduced under #393.