CKTIS / C++
not_eq — alternative spelling of the inequality operator
`not_eq` is a language-level alternative spelling of the C++ operator `!=`. It compares two operands using the same rules, precedence, and associativity; it requires neither a header nor a macro.
Version: C++23; repository compiler flag, production runtime not attested
Syntax
lhs not_eq rhsnot_eq is an alternative token for the operator !=, not a separate function. Writing lhs not_eq rhs means the same as writing lhs != rhs: only the token's spelling changes. Precedence, associativity, and operator selection rules remain the same.
For built-in integer comparisons, the result has type bool: true when the compared values differ, and false when they are equal. In the example, 3 not_eq 5 yields true, while 3 not_eq 3 yields false. Parentheses around the comparisons in the std::cout expression ensure the intended grouping.
not_eq is reserved by the language: you cannot use it as a variable name or define your own macro with that name. You do not need to include <iso646.h> or any other header to use this token. The example includes <iostream> only to print the results.
The example targets C++23 compilation mode. The static_assert checks at compile time that both spellings agree for the chosen operands. The displayed output was confirmed by running the displayed source unchanged in an isolated environment and checking that standard output matched exactly. The eel.is source is an evolving working draft, not a frozen C++23 publication; it does not attest to the production environment either.
Examples
#include <iostream>
int main() {
constexpr int actual = 3;
constexpr int expected = 5;
static_assert((actual not_eq expected) == (actual != expected));
std::cout << std::boolalpha
<< (actual not_eq expected) << '\n'
<< (actual not_eq actual) << '\n';
}
Result
true false
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.