You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7322e25
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -21,13 +21,12 @@ An alternative spelling for the **`!=`** operator.
21
21
## Remarks
22
22
23
23
C++:
24
-
- **`not_eq`** can be used as alternative to **`!=`**. The [`/permissive-`](../build/reference/permissive-standards-conformance.md) or [`/Za`](../build/reference/za-ze-disable-language-extensions.md) compiler option is required to use the alternative spelling.
24
+
- **`not_eq`** can be used as alternative to **`!=`**. The [`/permissive-`](../build/reference/permissive-standards-conformance.md) or [`/Za`](../build/reference/za-ze-disable-language-extensions.md) compiler option is required.
25
+
- Including `<iso646.h>` or `<ciso646>` is deprecated. You can use the alternative spelling without including any header files.
25
26
- There's no alternative spelling for **`==`**.
26
-
- Including `<iso646.h>` or `<ciso646>` is deprecated. Use the alternative spelling directly.
27
27
28
28
C:
29
29
- **`not_eq`** is an alternative spelling for **`!=`**. It is provided as a macro in `<iso646.h>`, which you must `#include`.
30
-
- The alternative spelling isn't treated as a keyword.
31
30
- There's no alternative spelling for **`==`**.
32
31
33
32
## Example
@@ -41,9 +40,9 @@ int main( )
41
40
{
42
41
int x = 1, y = 2;
43
42
44
-
// The alternative spelling is available in C++ and C
45
-
// This example is for C++, so no header file is needed to use the alternative spelling
46
-
// When compiling for C, #include <iso646.h> to use the alternative spelling
43
+
// not_eq is available in C++ and C
44
+
// This example is for C++, so no header file is needed to use not_eq
45
+
// When compiling for C, #include <iso646.h> to use not_eq
47
46
if (x not_eq y)
48
47
{
49
48
std::cout << "Not equal\n";
@@ -57,9 +56,9 @@ Not equal
57
56
58
57
## Requirements
59
58
60
-
**Header:**`<iso646.h>` is only necessary if you are compiling for C. In C++ the alternative spelling is recognized automatically.
59
+
**Header:**`<iso646.h>` is necessary if you are compiling for C.
The binary equality operators compare their operands for strict equality or inequality. If you are looking for information about overloading these operators instead, see [Operator overloading](../cpp/overloading.md).
17
+
The equality operators compare their operands for strict equality or inequality. If you are looking for information about overloading these operators, see [Operator overloading](../cpp/overloading.md).
18
18
19
19
The equal-to operator (**`==`**) returns **`true`** if both operands have the same value; otherwise **`false`**.\
20
20
The not-equal-to operator (**`!=`**) returns **`true`** if the operands don't have the same value; otherwise **`false`**.\
21
-
The alternative spelling `not_eq` returns **`true`** if the operands don't have the same value; otherwise **`false`**.
22
21
23
22
In C and C++, **`not_eq`** can be used as alternative to **`!=`**. For more information, see [`not-eq`](../c-runtime-library/reference/not-eq.md).
24
23
@@ -48,12 +47,6 @@ Equal
48
47
Not equal
49
48
```
50
49
51
-
Equality operators can compare pointers to members of the same type. The pointers are equal if they point to the same member or if they are both **`nullptr`**. Otherwise, they are not equal. For example
0 commit comments