See the C ++ standard. Draft Committee No. 2 is freely available at ftp://ftp.research.att.com/dist/c++std/WP/CD2/body.pdf , although it is not authoritative, outdated and partially incorrect in several places. In particular, in section 2.5 Alternative Tokens , the following values ββare defined:
Alternative primary
<% {
%>}
<: [
:>]
%: #
%:%: ##
and &&
bitor |
or ||
xor ^
compl ~
bitand &
and_eq & =
or_eq | =
xor_eq ^ =
not!
not_eq! =
Although honestly, I have never seen any of them ever used, except and , or and not , and even then it is rare. Please note that they are NOT allowed by default in plain C code, only in C ++. If you want to use them in C, you will either have to #define them yourself as macros, or the #include header <iso646.h> , which defines all of the above except for <% >% <: :> %: %:%: as macros (see section 7.9 of the C99 standard).
Adam Rosenfield Feb 17 '09 at 4:19 2009-02-17 04:19
source share