📄 c---named-operators.html
字号:
<html lang="en">
<head>
<title>The C Preprocessor</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="The C Preprocessor">
<meta name="generator" content="makeinfo 4.3">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
<!--
Copyright © 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
<p>Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation. A copy of
the license is included in the
section entitled "GNU Free Documentation License".
<p>This manual contains no Invariant Sections. The Front-Cover Texts are
(a) (see below), and the Back-Cover Texts are (b) (see below).
<p>(a) The FSF's Front-Cover Text is:
<p>A GNU Manual
<p>(b) The FSF's Back-Cover Text is:
<p>You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.
-->
</head>
<body>
<div class="node">
<p>
Node:<a name="C++%20Named%20Operators">C++ Named Operators</a>,
Previous:<a rel="previous" accesskey="p" href="System-specific-Predefined-Macros.html#System-specific%20Predefined%20Macros">System-specific Predefined Macros</a>,
Up:<a rel="up" accesskey="u" href="Predefined-Macros.html#Predefined%20Macros">Predefined Macros</a>
<hr><br>
</div>
<h4 class="subsection">C++ Named Operators</h4>
<p>In C++, there are eleven keywords which are simply alternate spellings
of operators normally written with punctuation. These keywords are
treated as such even in the preprocessor. They function as operators in
<code>#if</code>, and they cannot be defined as macros or poisoned. In C, you
can request that those keywords take their C++ meaning by including
<code>iso646.h</code>. That header defines each one as a normal object-like
macro expanding to the appropriate punctuator.
<p>These are the named operators and their corresponding punctuators:
<p><table><tr align="left"><td valign="top">Named Operator </td><td valign="top">Punctuator
<br></td></tr><tr align="left"><td valign="top"><code>and</code> </td><td valign="top"><code>&&</code>
<br></td></tr><tr align="left"><td valign="top"><code>and_eq</code> </td><td valign="top"><code>&=</code>
<br></td></tr><tr align="left"><td valign="top"><code>bitand</code> </td><td valign="top"><code>&</code>
<br></td></tr><tr align="left"><td valign="top"><code>bitor</code> </td><td valign="top"><code>|</code>
<br></td></tr><tr align="left"><td valign="top"><code>compl</code> </td><td valign="top"><code>~</code>
<br></td></tr><tr align="left"><td valign="top"><code>not</code> </td><td valign="top"><code>!</code>
<br></td></tr><tr align="left"><td valign="top"><code>not_eq</code> </td><td valign="top"><code>!=</code>
<br></td></tr><tr align="left"><td valign="top"><code>or</code> </td><td valign="top"><code>||</code>
<br></td></tr><tr align="left"><td valign="top"><code>or_eq</code> </td><td valign="top"><code>|=</code>
<br></td></tr><tr align="left"><td valign="top"><code>xor</code> </td><td valign="top"><code>^</code>
<br></td></tr><tr align="left"><td valign="top"><code>xor_eq</code> </td><td valign="top"><code>^=</code>
<br></td></tr></table>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -