[英]What is the purpose of the 'and', 'or', etc. keywords in C++?
What is the purpose of the following keywords? 以下关键字的目的是什么?
and bitand compl not_eq or_eq xor_eq
and_eq bitor not or xor
If all they are is a direct equivalent of: 如果他们只是直接相当于:
&& & ~ != |= ^=
&= | ! || ^
http://en.wikipedia.org/wiki/Iso646.h http://en.wikipedia.org/wiki/Iso646.h
iso646.h "...defines a number of macros which allow programmers to use C language bitwise and logical operators, which, without the header file, cannot be quickly or easily typed on some international and non-QWERTY keyboards. iso646.h” ......定义了许多宏允许程序员使用C语言位运算符和逻辑运算符,其中,无头文件,不能对一些国际和非QWERTY键盘很快或很容易输入的。
The filename refers to the ISO646 standard, a 7-bit character set with a number of regional variations, some of which have accented characters in place of the punctuation marks used by C operators." 文件名是指ISO646标准,这是一个7位字符集,带有许多区域变体,其中一些具有重音字符代替C运算符使用的标点符号。“
Its so you can write crazy code poems like: 这样你就可以编写疯狂的代码诗:
class jack
{
jack();
jack( jack & jill );
jack& came_tumbling( int after );
jack& fell( jack & jill );
jack& operator &= ( jack & jill );
jack& operator & ( jack & jill );
}
void to_fetch( int pail );
int a_pail;
int after;
jack broke_his_crown;
jack went_up_the_hill;
jack down;
jack and jill = went_up_the_hill;
to_fetch( a_pail ); // of water
jack fell( down and broke_his_crown
and jill.came_tumbling( after ));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.