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

Pure syntactic shape: T supports the bitwise / lattice operators &, |, ^, ~ with results convertible to T. More...

Concept definition

template<typename T>
concept dedekind::order::HasLatticeOperators = requires(T a, T b) {
{ a & b } -> std::convertible_to<T>;
{ a | b } -> std::convertible_to<T>;
{ a ^ b } -> std::convertible_to<T>;
{ ~a } -> std::convertible_to<T>;
}
Pure syntactic shape: T supports the bitwise / lattice operators &, |, ^, ~ with results convertible ...
Definition lattice.cppm:75

Detailed Description

Pure syntactic shape: T supports the bitwise / lattice operators &, |, ^, ~ with results convertible to T.

Use this concept where the callsite needs the lattice operators {meet, join, symmetric-difference, complement} to compile and yield a value coercible back into T — e.g. Boolean carriers, integer bit-twiddle types, sublattices of a Heyting algebra, the additive \(\mathbb{F}_2\) surface. No axiomatic claim about idempotency, absorption, distributivity, or De Morgan duality is made here; for those, use the certified lattice concepts below or the bundled IsOrderLattice further down.

The return-type is convertible_to<T> rather than same_as<T> (cf. the strict HasRingOperators) because integer promotion makes bool & bool -> int in C++; relaxing to convertibility lets the canonical Boolean carrier (bool) satisfy the concept via promotion-and-back.

Sibling of dedekind::algebra::HasRingOperators (in algebra:ring) and dedekind::category::HasLogicalOperators (in category:logic) in the shape-concept family — introduced under #393.